We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
# Your code here >>> print(pd.isna(pd.Series(['A', 'B', pd.np.nan], dtype='category'))) 0 False 1 False 2 True dtype: bool >>> print(pd.Series(['A', 'B', pd.np.nan], dtype='category').apply(pd.isna)) 0 False 1 False 2 False dtype: object >>> print(pd.Series(['A', 'A', pd.np.nan], dtype='category').apply(pd.isna)) 0 False 1 False 2 NaN dtype: category Categories (1, object): [False]
I would expect case 2 (['A', 'B', pd.np.nan]) to be either like case 1 or case 3. I think the correct behavior would be case 1.
['A', 'B', pd.np.nan]
Issue #21565 looks similar but not the same
0 False 1 False 2 True dtype: bool
in all cases.
Behaves as expected if dtype='category' is omitted
dtype='category'
pd.show_versions()
pandas: 0.23.4 pytest: 4.0.1 pip: 18.1 setuptools: 39.0.1 Cython: 0.29.1 numpy: 1.15.4 scipy: 1.1.0 pyarrow: None xarray: None IPython: 7.1.1 sphinx: None patsy: 0.5.1 dateutil: 2.7.5 pytz: 2018.7 blosc: None bottleneck: 1.2.1 tables: None numexpr: 2.6.8 feather: None matplotlib: 3.0.2 openpyxl: None xlrd: None xlwt: None xlsxwriter: None lxml: 3.7.3 bs4: 4.6.3 html5lib: None sqlalchemy: None pymysql: None psycopg2: None jinja2: 2.10 s3fs: None fastparquet: None pandas_gbq: None pandas_datareader: None
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
Code Sample, a copy-pastable example if possible
Problem description
I would expect case 2 (
['A', 'B', pd.np.nan]
) to be either like case 1 or case 3.I think the correct behavior would be case 1.
Issue #21565 looks similar but not the same
Expected Output
in all cases.
Behaves as expected if
dtype='category'
is omittedOutput of
pd.show_versions()
pandas: 0.23.4
pytest: 4.0.1
pip: 18.1
setuptools: 39.0.1
Cython: 0.29.1
numpy: 1.15.4
scipy: 1.1.0
pyarrow: None
xarray: None
IPython: 7.1.1
sphinx: None
patsy: 0.5.1
dateutil: 2.7.5
pytz: 2018.7
blosc: None
bottleneck: 1.2.1
tables: None
numexpr: 2.6.8
feather: None
matplotlib: 3.0.2
openpyxl: None
xlrd: None
xlwt: None
xlsxwriter: None
lxml: 3.7.3
bs4: 4.6.3
html5lib: None
sqlalchemy: None
pymysql: None
psycopg2: None
jinja2: 2.10
s3fs: None
fastparquet: None
pandas_gbq: None
pandas_datareader: None
The text was updated successfully, but these errors were encountered: