Path: csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed2.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.011 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'from:addr:yahoo.co.uk': 0.04; 'lawrence': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'subject:files': 0.09; 'subject:How': 0.10; 'csv': 0.16; 'iterating': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'red,': 0.16; 'wrote:': 0.18; 'header:User-Agent:1': 0.23; "i've": 0.25; 'header:X-Complaints- To:1': 0.27; 'header:In-Reply-To:1': 0.27; 'leave': 0.29; 'pickle': 0.31; 'file': 0.32; 'stuff': 0.32; 'open': 0.33; 'maybe': 0.34; "can't": 0.35; 'definition': 0.35; 'but': 0.35; 'accessing': 0.36; 'useful': 0.36; 'subject:?': 0.36; 'thank': 0.38; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'how': 0.40; 'read': 0.60; 'most': 0.60; 'effective': 0.61; 'simply': 0.61; 'you.': 0.62; 'relatively': 0.65; 'again?': 0.84; 'why?': 0.91 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Mark Lawrence Subject: Re: How pickle helps in reading huge files? Date: Wed, 16 Oct 2013 08:39:57 +0100 References: <0044bfd0-f07f-4f7b-b976-5df034b6fec6@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: host-78-147-19-253.as13285.net User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:24.0) Gecko/20100101 Thunderbird/24.0.1 In-Reply-To: <0044bfd0-f07f-4f7b-b976-5df034b6fec6@googlegroups.com> 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: 19 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1381909219 news.xs4all.nl 16009 [2001:888:2000:d::a6]:57498 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:56873 On 16/10/2013 07:55, Harsh Jha wrote: > I've a huge csv file and I want to read stuff from it again and again. Is it useful to pickle it and keep and then unpickle it whenever I need to use that data? Is it faster that accessing that file simply by opening it again and again? Please explain, why? > > Thank you. > What's your definition of huge? Maybe it would be effective to pickle and unpickle but until you try it, perhaps with a relatively small data sample, how can you know? Why can't you leave the file open and keep iterating over the contents? -- Roses are red, Violets are blue, Most poems rhyme, But this one doesn't. Mark Lawrence