NVIDIA / NVIDIA/cudf

[BUG] Column types after cudf.crosstab() does not match Pandas result

Open
#11,896 2 comments 0 reactions 0 assignees View on GitHub
0 - Backlog bug Python
Dominant language
C++
Stars
9.8k
Forks
1.1k
Avg merge
3d 6m
Merged PRs (30d)
278

Description

**Describe the bug**
Hi

While porting some code from Pandas, I have noticed that the column types after `cudf.crosstab()` does not match Pandas result.

Please, see a reproducer below:

```python
> > import cudf
> > import pandas as pd
> >
> > print(cudf.__version__, pd.__version__, '\n')
> >
> > features = {'x': ['x1', 'x1', 'x2', 'x2', 'x2', 'x1', 'x2'],
> > 'y': ['y1', 'y2', 'y1', 'y2', 'y3', 'y1', 'y3']}
> >
> > pdf = pd.DataFrame(features)
> > pdf = pd.crosstab(index = pdf.x, columns = pdf.y)
> >
> > gdf = cudf.DataFrame(features)
> > gdf = cudf.crosstab(index = gdf.x, columns = gdf.y)
> >
> > print(gdf.to_pandas().equals(pdf), '\n')
> > print(pdf.columns, '\n', gdf.columns)
> >
> > 22.10.00a0+g17868b7 1.5.0
> >
> > False
> >
> > Index(['y1', 'y2', 'y3'], dtype='object', name='y')
> > MultiIndex([('y1',),
> > ('y2',),
> > ('y3',)],
> > names=['y'])
>
```

**Expected behavior**
I would like the results between cuDF and Pandas match.

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.