Skip to content

Unable to read non-comma delimited files with ray.dataframe.read_csv  #1887

@ian-whitestone

Description

@ian-whitestone

System information

  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Mac OS Sierra 10.12.6
  • Ray installed from (source or binary): Installed with pip pip install ray
  • Ray version: 0.4.0
  • Python version: Python 3.6.4 |Anaconda, Inc.|

Describe the problem

I am unable to get the ray.dataframe.read_csv to properly read a pipe delimited file into a dataframe. Reading a comma-separated file works fine.

Here are two dummy text files I created:

pipe_delimited.txt

a|b|c
1|2|3
4|5|6
7|8|9
10|11|12

comma_delimited.txt

a,b,c
1,2,3
4,5,6
7,8,9
10,11,12
>>> import ray.dataframe as pd

>>> df = pd.read_csv('pipe_delimited.txt', delimiter='|')
>>> print (df.shape)
>>> print (df.columns)
(4, 1)
Index(['a|b|c'], dtype='object')

>>> df = pd.read_csv('comma_delimited.txt', delimiter=',')
>>> print (df.shape)
>>> print (df.columns)
(4, 3)
Index(['a', 'b', 'c'], dtype='object')

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions