Skip to content

Commit 0fe864b

Browse files
committed
BUG: Fix isna cannot handle ambiguous typed list
1 parent ef019fa commit 0fe864b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pandas/core/dtypes/missing.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import numpy as np
55
from pandas._libs import lib, missing as libmissing
66
from pandas._libs.tslib import NaT, iNaT
7+
from pandas.core.dtypes import cast
78
from .generic import (ABCMultiIndex, ABCSeries,
89
ABCIndexClass, ABCGeneric,
910
ABCExtensionArray)
@@ -120,7 +121,9 @@ def _isna_new(obj):
120121
return _isna_ndarraylike(obj)
121122
elif isinstance(obj, ABCGeneric):
122123
return obj._constructor(obj._data.isna(func=isna))
123-
elif isinstance(obj, list) or hasattr(obj, '__array__'):
124+
elif isinstance(obj, list):
125+
return _isna_ndarraylike(np.asarray(obj, dtype=object))
126+
elif hasattr(obj, '__array__'):
124127
return _isna_ndarraylike(np.asarray(obj))
125128
else:
126129
return obj is None
@@ -202,6 +205,7 @@ def _isna_ndarraylike(obj):
202205

203206
if is_string_like_dtype(dtype):
204207
# object array of strings
208+
print('str')
205209
result = np.zeros(values.shape, dtype=bool)
206210
else:
207211
# object array of non-strings

0 commit comments

Comments
 (0)