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
LocIndexer of a DataFrame with a MultiIndex columns with a single label tuple returns DataFrame instead of a Series
Steps/Code to reproduce bug
In [50]: import cudf
In [51]: cudf.__version__
Out[51]: '23.10.00'
In [52]: dfmi = cudf.DataFrame([list('abcd'),
...:
...: list('efgh'),
...:
...: list('ijkl'),
...:
...: list('mnop')],
...:
...: columns=cudf.MultiIndex.from_product([['one', 'two'],
...:
...: ['first', 'second']]))
In [53]: dfmi.loc[:, ('one', 'second')]
Out[53]:
(one, second)
0 b
1 f
2 j
3 n
In [54]: dfmi.to_pandas().loc[:, ('one', 'second')]
Out[54]:
0 b
1 f
2 j
3 n
Name: (one, second), dtype: object
Expected behavior
Like pandas, a single tuple label should be treated like a scalar label instead of a container of labels and return a Series instead of a DataFrame
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:
Describe the bug
LocIndexer of a DataFrame with a MultiIndex columns with a single label tuple returns DataFrame instead of a Series
Steps/Code to reproduce bug
Expected behavior
Like pandas, a single tuple label should be treated like a scalar label instead of a container of labels and return a Series instead of a DataFrame
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: