NVIDIA / NVIDIA/cudf

[FEA] Int64Index for header=None in CSV reader

Open
#12,582 3 comments 0 reactions 0 assignees View on GitHub
0 - Backlog cuIO feature request libcudf Python
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.**
Pandas read_csv without header returns integers as column names. cudf read_csv returns integer numbers as strings.

```python
import cudf
from io import StringIO
import pandas as pd
csv="1, 2, 3\n4, 5, 6\n7, 8, 9\n"

In [11]: cudf.read_csv(StringIO(csv), header=None).columns
Out[11]: Index(['0', '1', '2'], dtype='object')

In [12]: pd.read_csv(StringIO(csv), header=None).columns
Out[12]: Int64Index([0, 1, 2], dtype='int64')
```

Similar issue will happen in JSON reader also after "values" support in JSON reader PR https://github.com/rapidsai/cudf/pull/12498#discussion_r1070188657

**Describe the solution you'd like**
The libcudf csv reader does not have a method to return metadata as non-string types. Provide a way to indicate there is no header information in metadata. It's possible to fix this issue at Cython/Python layer.

**Additional context**
PR Comment https://github.com/rapidsai/cudf/pull/12498#discussion_r1070188657

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.