[BUG] `DataFrame.iloc` returns the wrong type of object when a string column is present
Open
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
Assessment
This issue has not been assessed yet.