Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #75349

Re: Load a CSV with different row lengths

References <CAKcMNB+pYdcETcCs=QEPhU-mLr3nwqX0T66_jT1zq-vgWGMeLg@mail.gmail.com> <CANc-5UxaZh6So8cy94FV17ic6MzFh0L5LZrk+3SZbyCPCtUUmQ@mail.gmail.com>
Date 2014-07-29 09:08 -0400
Subject Re: Load a CSV with different row lengths
From Ryan de Vera <ryan.devera.03@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.12416.1406639326.18130.python-list@python.org> (permalink)

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

Hey skip,

I should've mentioned that I want to import my csv as a data frame or numpy
array or as a table.

Best regards,

Ryan


On Tue, Jul 29, 2014 at 6:29 AM, Skip Montanaro <skip@pobox.com> wrote:

> > How can I load this into python? I tried using both NumPy and Pandas.
>
> To add to Peter's response, I would be very surprised if numpy or
> Pandas couldn't be coaxed into loading your CSV file, but you didn't
> provide any details about what you expected and what you got. I've
> used Pandas to read CSV files a lot recently, and run into any
> trouble. (I suspect all but a few have equal length rows, but in cases
> where data are missing, I've found it generally inserts NaNs.)
>
> In general, you'll get more useful feedback with more complete
> questions. I'm not saying you need to necessarily provide code, but a
> traceback or unexpected output would be helpful.
>
> Skip
>

Back to comp.lang.python | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Re: Load a CSV with different row lengths Ryan de Vera <ryan.devera.03@gmail.com> - 2014-07-29 09:08 -0400
  Re: Load a CSV with different row lengths Miki Tebeka <miki.tebeka@gmail.com> - 2014-07-29 22:00 -0700
    Re: Load a CSV with different row lengths Peter Otten <__peter__@web.de> - 2014-07-30 10:16 +0200

csiph-web