NVIDIA / NVIDIA/cudf

[FEA] Supporting separators with more than 1 character in cudf.read_csv method

Open
#9,987 6 comments 0 reactions 0 assignees View on GitHub
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.**
When calling the method _cudf.read_csv_, the _sep_ argument only accepts a 1 character string - which was an old issue in pandas. However, they have already included support for multi-character separators and it would be a useful thing to have on cudf.

**Describe the solution you'd like**
Calling the _cudf.read_csv_ method as

```python
cudf.read_csv(filepath, sep='::')
```

**Describe alternatives you've considered**
Perhaps allowing users to use a regex as a separator definer would provide a more robust solution.

**Additional context**
Python code example

```python
import pandas as pd
import cudf

filepath = './example.csv'
with open(filepath, 'w') as f:
f.write('column0::column1\n')
f.write('value00::value01\n')
f.write('value10::value11\n')

df_pandas = pd.read_csv(filepath, sep='::')
print ('Loaded csv file from pandas')
df_cudf = cudf.read_csv(filepath, sep='::')
print ('Loaded csv file from cudf')
```

Current output: `ValueError: only single character unicode strings can be converted to Py_UCS4, got length 2`

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.