Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitaa6f6ee

Browse files
committed
Minor code cleanups in basic_units example
1 parentc112a5e commitaa6f6ee

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

‎examples/units/basic_units.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -348,9 +348,9 @@ def convert(val, unit, axis):
348348
ifunits.ConversionInterface.is_numlike(val):
349349
returnval
350350
ifnp.iterable(val):
351-
ifnp.ma.isMaskedArray(val):
351+
ifisinstance(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
fori,thisvalinenumerate(val):
355355
ifnp.ma.is_masked(thisval):
356356
out[i]=np.nan

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp