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


Groups > comp.lang.python > #75347

Re: Load a CSV with different row lengths

References <CAKcMNB+pYdcETcCs=QEPhU-mLr3nwqX0T66_jT1zq-vgWGMeLg@mail.gmail.com>
Date 2014-07-29 05:29 -0500
Subject Re: Load a CSV with different row lengths
From Skip Montanaro <skip@pobox.com>
Newsgroups comp.lang.python
Message-ID <mailman.12414.1406629762.18130.python-list@python.org> (permalink)

Show all headers | View raw


> 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 | Next | Find similar | Unroll thread


Thread

Re: Load a CSV with different row lengths Skip Montanaro <skip@pobox.com> - 2014-07-29 05:29 -0500

csiph-web