NVIDIA / NVIDIA/cudf

[BUG] `DataFrame.iloc` returns the wrong type of object when a string column is present

Open
#11,477 14 comments 1 reaction 0 assignees View on GitHub
bug Python
Dominant language
C++
Stars
9.8k
Forks
1.1k
Avg merge
3d 6m
Merged PRs (30d)
278

Description

**Describe the bug**
In the cases described in the title, we are getting a `DataFrame` rather than a `Series` object like we should.

**Steps/Code to reproduce bug**
```python
>>> df1 = cudf.DataFrame({
... 'a': [1, 2, 3],
... 'b': ['a', 'b', 'c']
... })
>>> df2 = cudf.DataFrame({
... 'a': [1, 2, 3],
... 'b': [4, 5, 6]
... })
>>> type(df1.iloc[0])

>>> type(df2.iloc[0])

>>> type(df1.to_pandas().iloc[0])

>>> type(df2.to_pandas().iloc[0])

```

**Expected behavior**
We should get the same object as pandas (a series)

**Additional Information**
Branch-22.10

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.