New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pd.isnull() raises AttributeError on Pandas type objects #27482
Labels
Milestone
Comments
Probably need to include something like 128 def _isna_new(obj):
129 if is_scalar(obj):
130 return libmissing.checknull(obj)
131 # hack (for now) because MI registers as ndarray
132 elif isinstance(obj, ABCMultiIndex):
133 raise NotImplementedError("isna is not defined for MultiIndex")
134 elif isinstance(
135 obj,
136 (
137 ABCSeries,
138 np.ndarray,
139 ABCIndexClass,
140 ABCExtensionArray,
141 ABCDatetimeArray,
142 ABCTimedeltaArray,
143 ),
144 ):
--> 145 return _isna_ndarraylike(obj) |
5 tasks
SvoONs
added a commit
to SvoONs/pandas
that referenced
this issue
Jul 30, 2019
SvoONs
added a commit
to SvoONs/pandas
that referenced
this issue
Jul 30, 2019
SvoONs
added a commit
to SvoONs/pandas
that referenced
this issue
Jul 30, 2019
2 tasks
pradeepb2505
added a commit
to pradeepb2505/pandas
that referenced
this issue
Aug 18, 2019
pradeepb2505
added a commit
to pradeepb2505/pandas
that referenced
this issue
Aug 18, 2019
5 tasks
pradeepb2505
added a commit
to pradeepb2505/pandas
that referenced
this issue
Aug 18, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Problem description
I'm using a list comprehension and
pd.isnull()
to remove empty items from a list ([x for x in l if not pd.isnull(x)]
). When one of my users passes a pandastype
object to this logic, it gums up the works by raising an AttributeError. This logic works as expected withtype
objects from Python's builtins:Expected Output
Both calls to
pd.isnull()
above should returnFalse
. The type objects are not null/None
/NaN
/missing.Output of
pd.show_versions()
INSTALLED VERSIONS
commit : None
python : 3.7.3.final.0
python-bits : 64
OS : Linux
OS-release : 4.19.0-5-amd64
machine : x86_64
processor :
byteorder : little
LC_ALL : None
LANG : en_US.UTF-8
LOCALE : en_US.UTF-8
pandas : 0.25.0
numpy : 1.16.4
pytz : 2019.1
dateutil : 2.8.0
pip : 19.1.1
setuptools : 41.0.1
Cython : None
pytest : None
hypothesis : None
sphinx : None
blosc : None
feather : None
xlsxwriter : None
lxml.etree : None
html5lib : None
pymysql : None
psycopg2 : None
jinja2 : None
IPython : None
pandas_datareader: None
bs4 : None
bottleneck : None
fastparquet : None
gcsfs : None
lxml.etree : None
matplotlib : None
numexpr : None
odfpy : None
openpyxl : None
pandas_gbq : None
pyarrow : None
pytables : None
s3fs : None
scipy : None
sqlalchemy : None
tables : None
xarray : None
xlrd : None
xlwt : None
xlsxwriter : None
The text was updated successfully, but these errors were encountered: