[FEA] automatic construction of MultiIndex DataFrame
- 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.**
rewriting code from pandas into cudf, using `import cudf as pd`
**Describe the solution you'd like**
```
>>> import pandas as pd
>>> import cudf
>>> cudf.__version__
'22.12.00a+281.gcc4b4dd27c'
>>> df = pd.DataFrame([[1],[2]], index=[['a', 'a'],['b','c']])
>>> df
0
a b 1
c 2
>>> cudf.DataFrame([[1],[2]], index=[['a', 'a'],['b','c']])
Traceback (most recent call last):
File "", line 1, in
File "/opt/conda/envs/rapids/lib/python3.9/contextlib.py", line 79, in inner
return func(*args, **kwds)
File "/opt/conda/envs/rapids/lib/python3.9/site-packages/cudf/core/dataframe.py", line 710, in __init__
self._init_from_list_like(
File "/opt/conda/envs/rapids/lib/python3.9/contextlib.py", line 79, in inner
return func(*args, **kwds)
File "/opt/conda/envs/rapids/lib/python3.9/site-packages/cudf/core/dataframe.py", line 838, in _init_from_list_like
index = as_index(index)
File "/opt/conda/envs/rapids/lib/python3.9/contextlib.py", line 79, in inner
return func(*args, **kwds)
File "/opt/conda/envs/rapids/lib/python3.9/site-packages/cudf/core/index.py", line 3019, in as_index
return as_index(
File "/opt/conda/envs/rapids/lib/python3.9/contextlib.py", line 79, in inner
return func(*args, **kwds)
File "/opt/conda/envs/rapids/lib/python3.9/site-packages/cudf/core/index.py", line 3005, in as_index
return _index_from_data({kwargs.get("name", None): arbitrary})
File "/opt/conda/envs/rapids/lib/python3.9/site-packages/cudf/core/index.py", line 122, in _index_from_data
raise NotImplementedError(
NotImplementedError: Unsupported column type passed to create an Index:
```
i would like the same functionality in `cudf` as is present in `pandas` (see https://pandas.pydata.org/docs/user_guide/advanced.html#hierarchical-indexing-multiindex)
Contributor guide
Assessment
This issue has not been assessed yet.