Load a CSV with different row lengths

Ryan de Vera ryan.devera.03 at gmail.com
Tue Jul 29 09:08:44 EDT 2014


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 at 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20140729/130d4165/attachment.html>


More information about the Python-list mailing list