Skip to content

Commit 5004e70

Browse files
committed
update
1 parent 56eded4 commit 5004e70

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

netCDF4/utils.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -365,14 +365,14 @@ def _StartCountStride(elem, shape, dimensions=None, grp=None, datashape=None,\
365365
datashape = broadcasted_shape(shape, datashape)
366366

367367
# pad datashape with zeros for dimensions not being sliced (issue #906)
368-
# only used when there is a slice over only one dimension
368+
# only used when data covers slice over subset of dimensions
369369
if datashape and len(datashape) != len(elem) and\
370370
len(datashape) == sum(1 for e in elem if type(e) == slice):
371371
datashapenew = (); i=0
372372
for e in elem:
373-
if type(e) != slice:
373+
if type(e) != slice and not np.iterable(e): # scalar integer slice
374374
datashapenew = datashapenew + (0,)
375-
else:
375+
else: # slice object
376376
datashapenew = datashapenew + (datashape[i],)
377377
i+=1
378378
datashape = datashapenew

0 commit comments

Comments
 (0)