Uploaded image for project: 'Apache Arrow'
  1. Apache Arrow
  2. ARROW-4824

[Python] read_csv should accept io.StringIO objects

    XMLWordPrintableJSON

Details

    Description

      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

       

      Attachments

        Issue Links

          Activity

            People

              apitrou Antoine Pitrou
              dhirschfeld Dave Hirschfeld
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 0.5h
                  0.5h