[FEA] Allow ColumnAccessor to track MultiIndex levels that are Categorical or RangeIndex
- 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
Assessment
This issue has not been assessed yet.