Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
jswhit committed May 3, 2019
1 parent 56eded4 commit 5004e70
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions netCDF4/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -365,14 +365,14 @@ def _StartCountStride(elem, shape, dimensions=None, grp=None, datashape=None,\
datashape = broadcasted_shape(shape, datashape)

# pad datashape with zeros for dimensions not being sliced (issue #906)
# only used when there is a slice over only one dimension
# only used when data covers slice over subset of dimensions
if datashape and len(datashape) != len(elem) and\
len(datashape) == sum(1 for e in elem if type(e) == slice):
datashapenew = (); i=0
for e in elem:
if type(e) != slice:
if type(e) != slice and not np.iterable(e): # scalar integer slice
datashapenew = datashapenew + (0,)
else:
else: # slice object
datashapenew = datashapenew + (datashape[i],)
i+=1
datashape = datashapenew
Expand Down

0 comments on commit 5004e70

Please # to comment.