-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Regression in 0.24: TypeError exception when using dropna on dataframe with categorical index #25087
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
Comments
Referencing #24048 that changed the |
Have got a PR out for this #25090. |
@jreback if you are changing milestones for regressions, can you leave them on 0.24.3 ? |
@jorisvandenbossche we are highly unlikely to do a 0.24.3 |
That's not how I interpreted the discussion from the dev meeting (but we also didn't discuss it in detail ..). In any case, if you don't want to tag remaining regressions with 0.24.3, can you raise that in the 0.24.x release issue: #24949 ? |
I just wanted to check the status on this issue. Will there be a 0.24.3 release addressing this? Personally, I think it's an important issue to deal with for using machine learning with pandas. Are there other PRs that may fix the failing builds on windows/macOS that can be merged into #25090? |
I'm running into the same error for this sequence:
'0.24.2'
|
This will be fixed by #27100. A more concise equivalent example for testing purposes: In [1]: import pandas as pd; pd.__version__
Out[1]: '0.24.2'
In [2]: idx = pd.CategoricalIndex(pd.IntervalIndex.from_breaks([0, 2.78, 3.14, 6.28]))
In [3]: df = pd.DataFrame({'A': list('abc')}, index=idx)
In [4]: df
Out[4]:
A
(0.0, 2.78] a
(2.78, 3.14] b
(3.14, 6.28] c
In [5]: df.dropna()
---------------------------------------------------------------------------
TypeError: Cannot cast array data from dtype('float64') to dtype('<U32') according to the rule 'safe' |
Code Sample, a copy-pastable example if possible
Problem description
The call to dropna raised the following exception:
This seems to happen only with a categorical index for which the intervals are not all of the same length.
There was no issue in version 0.23.4 and the issue is not fixed in the master
Expected Output
No exception should be raised.
Output of
pd.show_versions()
INSTALLED VERSIONS
commit: 25ff472
python: 3.7.2.final.0
python-bits: 64
OS: Linux
OS-release: 4.19.15-300.fc29.x86_64
machine: x86_64
processor: x86_64
byteorder: little
LC_ALL: None
LANG: en_CA.UTF-8
LOCALE: en_CA.UTF-8
pandas: 0.25.0.dev0+44.g25ff47292
pytest: None
pip: 19.0.1
setuptools: 40.6.3
Cython: 0.29.4
numpy: 1.16.1
scipy: 1.2.0
pyarrow: None
xarray: None
IPython: 7.2.0
sphinx: None
patsy: 0.5.1
dateutil: 2.7.5
pytz: 2018.9
blosc: None
bottleneck: None
tables: None
numexpr: None
feather: None
matplotlib: 3.0.2
openpyxl: None
xlrd: None
xlwt: None
xlsxwriter: None
lxml.etree: None
bs4: None
html5lib: None
sqlalchemy: None
pymysql: None
psycopg2: None
jinja2: 2.10
s3fs: None
fastparquet: None
pandas_gbq: None
pandas_datareader: None
gcsfs: None
The text was updated successfully, but these errors were encountered: