NVIDIA / NVIDIA/cudf

[FEA] Allow ColumnAccessor to track MultiIndex levels that are Categorical or RangeIndex

Open
#14,267 1 comment 0 reactions 0 assignees View on GitHub
feature request Python
Dominant language
C++
Stars
9.8k
Forks
1.1k
Avg merge
3d 6m
Merged PRs (30d)
278

Description

**Is your feature request related to a problem? Please describe.**
Currently, `DataFrame.columns` that is a `MultiIndex` will not correctly return levels that are `Categorical` or wrapped in a `RangeIndex` like pandas. This is because dtype inference in done by pandas but cannot infer the above points:

https://github.com/rapidsai/cudf/blob/5039d043a08e7ea7e5656bab60a6fced4dfa2f1d/python/cudf/cudf/core/column_accessor.py#L265

**Describe the solution you'd like**
`ColumnAccessor` will probably need to track whether each level was created by a `Index` or `CategoricalIndex` or `RangeIndex` in order for `DataFrame.columns` to not lose this information.

**Describe alternatives you've considered**
Not sure...

**Additional context**
Add any other context, code examples, or references to existing implementations about the feature request here.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.