Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!goblin1!goblin.stu.neva.ru!news.astraweb.com!border5.a.newsrouter.astraweb.com!xlned.com!feeder5.xlned.com!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!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.013 X-Spam-Evidence: '*H*': 0.97; '*S*': 0.00; 'error:': 0.07; 'subject:file': 0.07; 'iterate': 0.09; 'rows': 0.09; 'cc:addr :python-list': 0.11; '"n"': 0.16; '23,': 0.16; 'columns': 0.16; 'csv': 0.16; 'once.': 0.16; 'subject:CSV': 0.16; 'subject:Reading': 0.16; 'wrote:': 0.18; 'memory': 0.22; 'email addr:gmail.com>': 0.22; 'cc:addr:python.org': 0.22; 'this?': 0.23; 'documented': 0.24; 'cc:2**0': 0.24; 'cc:no real name:2**0': 0.24; 'certain': 0.27; 'header:In-Reply-To:1': 0.27; 'tried': 0.27; 'array': 0.29; 'message-id:@mail.gmail.com': 0.30; 'prints': 0.31; 'file': 0.32; 'url:python': 0.33; 'at:': 0.34; 'but': 0.35; 'received:google.com': 0.35; 'url:org': 0.36; 'too': 0.37; 'skip:& 10': 0.38; 'url:library': 0.38; 'pm,': 0.38; '8bit%:6': 0.40; 'how': 0.40; 'read': 0.60; 'url:3': 0.61; 'skip:* 10': 0.61; 'save': 0.62; 'to:addr:gmail.com': 0.65; 'to:charset:iso-8859-1': 0.74; 'ana': 0.84; '2013': 0.98 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=XWM6n5TkH7UyUNP24LcCrJQm8ExSnEqu0m9PxO2fyDY=; b=Uiq4u0YQHsWggCPae5WR2qTbCihsVD+y4B3RqQT9d12/bIUyzteMeZXLkLIzUewbVN /ce47pL3L3mFlpTpYzSOccFeuf1LZ6ikHZAJuw0aDVsgmbmoVLovCV4kX4drW2qluU8x DT9V6HYes0C4mgtRD0JAOE+BYNNrMaudjT0R0HVpTBNdCGYNBB8WEpH+zVAkSN7rwrm5 u/yV3jBHDxowmdB/W4Ufn+8raTyxAgsMFITL7uOpTHCi/0CENY1ESfC3wXZOmqVYcOU/ iXuTQRDrhiS9BulhLvpHdo/DOQKKWYpPjUbvgMz3SfAvdDw8jFAaPrfBJ6nLgwKM0iYQ adnQ== MIME-Version: 1.0 X-Received: by 10.224.17.72 with SMTP id r8mr27411219qaa.48.1366753787488; Tue, 23 Apr 2013 14:49:47 -0700 (PDT) In-Reply-To: <9d0d46e5-b579-4edc-be34-0aa8798b66f8@googlegroups.com> References: <9d0d46e5-b579-4edc-be34-0aa8798b66f8@googlegroups.com> Date: Tue, 23 Apr 2013 14:49:47 -0700 Subject: Re: Reading a CSV file From: Dan Stromberg To: =?ISO-8859-1?Q?Ana_Dion=EDsio?= Content-Type: multipart/alternative; boundary=14dae93995f5ffae8a04db0e2939 Cc: python-list@python.org 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: 63 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1366753795 news.xs4all.nl 2177 [2001:888:2000:d::a6]:37711 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:44223 --14dae93995f5ffae8a04db0e2939 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On Tue, Apr 23, 2013 at 2:39 PM, Ana Dion=EDsio w= rote: > Hello! > > I need to read a CSV file that has "n" rows and "m" columns and if a > certain condition is met, for exameple n=3D=3D200, it prints all the colu= mns in > that row. How can I do this? I tried to save all the data in a > multi-dimensional array but I get this error: > > "ValueError: array is too big Use: csv.reader(*csvfile*, *dialect=3D'excel'*, ***fmtparams*)=B6 This will allow you to iterate over the values, instead of reading them all into memory at once. csv.reader is documented at: http://docs.python.org/3/library/csv.html http://docs.python.org/2/library/csv.html --14dae93995f5ffae8a04db0e2939 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
On Tue, Apr 23, 2013 at 2:39 PM, Ana Dion=ED= sio <anadionisio257@gmail.com> wrote:
Hello!

I need to read a CSV file that has "n" rows and "m" col= umns and if a certain condition is met, for exameple n=3D=3D200, it prints = all the columns in that row. How can I do this? I tried to save all the dat= a in a multi-dimensional array but I get this error:

"ValueError: array is too big
--14dae93995f5ffae8a04db0e2939--