Skip to content

Commit a5f6576

Browse files
committed
Added new names for pandas isna/notna unary functions
In pandas commit pandas-dev/pandas@7930202 isna and notna were added as aliases for isnull and notnull. Those need to be added to PANDAS_UNARY_FUNCTIONS for xarray datasets notnull to work. Closes pydata#1663.
1 parent 120e039 commit a5f6576

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

xarray/core/ops.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@
4242
# wrapped in an Variable/DataArray
4343
NUMPY_UNARY_METHODS = ['astype', 'argsort', 'clip', 'conj', 'conjugate']
4444
PANDAS_UNARY_FUNCTIONS = ['isnull', 'notnull']
45+
if pd.__version__ >= "0.21":
46+
PANDAS_UNARY_FUNCTIONS.extend(['isna', 'notna'])
4547
# methods which remove an axis
4648
REDUCE_METHODS = ['all', 'any']
4749
NAN_REDUCE_METHODS = ['argmax', 'argmin', 'max', 'min', 'mean', 'prod', 'sum',

0 commit comments

Comments
 (0)