You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
reindexing a DataFrame with a CategoricalIndex incorrectly matches label and drops Index name
Steps/Code to reproduce bug
In [53]: import cudf; import numpy as np
In [54]: cudf.__version__
Out[54]: '23.10.00'
In [55]: df3 = cudf.DataFrame(
...:
...: {"A": np.arange(3), "B": cudf.Series(list("abc")).astype("category")}
...:
...: )
...:
...:
...:
...: df3 = df3.set_index("B")
...:
...: df3
Out[55]:
A
B
a 0
b 1
c 2
In [56]: df3.reindex(["a", "e"])
Out[56]:
A
a <NA>
e <NA>
In [57]: df3.to_pandas().reindex(["a", "e"])
Out[57]:
A
B
a 0.0
e NaN
Expected behavior
Reindexing by an existing category with CategoricalIndex should not return NA
The existing CategoricalIndex name should be maintained
Environment overview (please complete the following information)
Environment location: Bare-metal
Method of cuDF install: conda
If method of install is [Docker], provide docker pull & docker run commands used
Environment details
Please run and paste the output of the cudf/print_env.sh script here, to gather any other relevant environment details
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered:
Fixes: #13900
This PR fixes an issue with `reindex` API, where `name` of the index being reindexed upon was lost. This PR fixes it to match pandas by using the new index name if it exists or preserving the old name.
Authors:
- GALI PREM SAGAR (https://github.com/galipremsagar)
Approvers:
- Bradley Dice (https://github.com/bdice)
URL: #13917
Describe the bug
reindexing a DataFrame with a CategoricalIndex incorrectly matches label and drops Index name
Steps/Code to reproduce bug
Expected behavior
Environment overview (please complete the following information)
docker pull
&docker run
commands usedEnvironment details
Please run and paste the output of the
cudf/print_env.sh
script here, to gather any other relevant environment detailsAdditional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: