You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@arrow.apache.org by "Antoine Pitrou (JIRA)" <ji...@apache.org> on 2019/04/22 13:45:00 UTC

[jira] [Commented] (ARROW-4824) [Python] read_csv should accept io.StringIO objects

    [ https://issues.apache.org/jira/browse/ARROW-4824?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16823111#comment-16823111 ] 

Antoine Pitrou commented on ARROW-4824:
---------------------------------------

Actually, only binary files are accepted by the CSV reader. However, the error should be better than what you're getting :-)

> [Python] read_csv should accept io.StringIO objects
> ---------------------------------------------------
>
>                 Key: ARROW-4824
>                 URL: https://issues.apache.org/jira/browse/ARROW-4824
>             Project: Apache Arrow
>          Issue Type: Improvement
>          Components: Python
>    Affects Versions: 0.12.1
>            Reporter: Dave Hirschfeld
>            Assignee: Antoine Pitrou
>            Priority: Minor
>             Fix For: 0.14.0
>
>
> It would be nice/convenient if `read_csv` also supported `io.StringIO` objects:
>  
> {{In [59]: csv = io.StringIO('''issue_date_utc,variable_name,station_name,station_id,value_date_utc,value}}
> {{    ...: 2019-02-26 22:00:00,TEMPERATURE,ARCHERFIELD,040211,2019-02-27 03:00,29.1}}
> {{    ...: ''')}}
> {{In [60]: pd.read_csv(csv)}}
> {{Out[60]: }}
> {{        issue_date_utc variable_name  ...    value_date_utc  value}}
> {{0  2019-02-26 22:00:00   TEMPERATURE  ...  2019-02-27 03:00   29.1}}
> {{[1 rows x 6 columns]}}
> {{In [61]: pa.csv.read_csv(csv)}}
> {{Traceback (most recent call last):}}
> {{  File "<ipython-input-61-d86447415aa3>", line 1, in <module>}}
> {{    pa.csv.read_csv(csv)}}
> {{SystemError: <built-in function read_csv> returned NULL without setting an error}}
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)