Skip to content

Commit aa6f6ee

Browse files
committed
Minor code cleanups in basic_units example
1 parent c112a5e commit aa6f6ee

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

examples/units/basic_units.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -348,9 +348,9 @@ def convert(val, unit, axis):
348348
if units.ConversionInterface.is_numlike(val):
349349
return val
350350
if np.iterable(val):
351-
if np.ma.isMaskedArray(val):
351+
if isinstance(val, np.ma.MaskedArray):
352352
val = val.astype(float).filled(np.nan)
353-
out = np.empty((len(val),), dtype=float)
353+
out = np.empty(len(val))
354354
for i, thisval in enumerate(val):
355355
if np.ma.is_masked(thisval):
356356
out[i] = np.nan

0 commit comments

Comments
 (0)