Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed3a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.015 X-Spam-Evidence: '*H*': 0.97; '*S*': 0.00; 'output': 0.05; 'table.': 0.07; 'inserts': 0.09; 'rows,': 0.09; 'to:addr:pobox.com': 0.09; 'to:addr:skip': 0.09; 'cc:addr:python-list': 0.11; 'csv': 0.16; 'numpy': 0.16; 'subject:CSV': 0.16; 'unexpected': 0.16; 'wrote:': 0.18; 'hey': 0.18; 'file,': 0.19; 'code,': 0.22; 'import': 0.22; 'python?': 0.22; 'saying': 0.22; 'cc:addr:python.org': 0.22; 'load': 0.23; 'skip': 0.24; 'cc:2**0': 0.24; "i've": 0.25; '>': 0.26; 'header:In-Reply-To:1': 0.27; 'tried': 0.27; 'am,': 0.29; 'array': 0.29; 'generally': 0.29; 'message-id:@mail.gmail.com': 0.30; "i'm": 0.30; 'helpful.': 0.31; 'loading': 0.31; 'run': 0.32; 'cases': 0.33; 'subject:with': 0.35; 'equal': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'add': 0.35; 'ryan': 0.36; "didn't": 0.36; 'useful': 0.36; 'expected': 0.38; 'feedback': 0.38; 'files': 0.38; "couldn't": 0.39; 'how': 0.40; 'read': 0.60; 'length': 0.61; 'mentioned': 0.61; "you'll": 0.62; 'complete': 0.62; 'provide': 0.64; 'more': 0.64; 'details': 0.65; 'jul': 0.74; 'subject:Load': 0.84; 'response,': 0.91; 'trouble.': 0.91 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=zsGiSaJIIl03urRtviS3gpEt6zFmkWWvTgJHqzmr/Ag=; b=NmqPW8VyU6YjNhtup71ozkW1uUWNE5LHKy6TMKsvcNZBg7PLENVK/6xSq6kH/qLkR9 2rLgkOk/cQTbJp1kenULKLHUKYblp0+/2VWYESi859yxh5A0MIeOOU995nnIgoJgKFSY XPeq3mvtSa7xoJwHqnbiQH3YETq7xMDOvxMfiZfmype/Z+vyJp2OzlGUbn79DgZ+K638 CFz5JS0uQJsr/pqZ16+qOF3EzHBUsKz87qcmizFfICswgxperu3h1aMN8m8JrbZYJUwb rHKMDmFSCwJHc4MrPCR8vHJUhiIn36NYumr8G8T5Wcf++K8cfnfzdWJtXFx9KbAv65+L kzNA== MIME-Version: 1.0 X-Received: by 10.182.112.134 with SMTP id iq6mr3363480obb.34.1406639324075; Tue, 29 Jul 2014 06:08:44 -0700 (PDT) In-Reply-To: References: Date: Tue, 29 Jul 2014 09:08:44 -0400 Subject: Re: Load a CSV with different row lengths From: Ryan de Vera To: Skip Montanaro Content-Type: multipart/alternative; boundary=089e0149cf603d1cd104ff54bd5b Cc: Python X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 65 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1406639326 news.xs4all.nl 2893 [2001:888:2000:d::a6]:46304 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:75349 --089e0149cf603d1cd104ff54bd5b Content-Type: text/plain; charset=UTF-8 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 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 > --089e0149cf603d1cd104ff54bd5b Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hey skip,=C2=A0

I should've mention= ed that I want to import my csv as a data frame or numpy array or as a tabl= e.

Best regards,=C2=A0

Ry= an=C2=A0


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 Nu= mPy 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

--089e0149cf603d1cd104ff54bd5b--