Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!feeder.news-service.com!tudelft.nl!txtfeed1.tudelft.nl!multikabel.net!newsfeed20.multikabel.net!news2.euro.net!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.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; '2.6.4': 0.07; 'ascii': 0.07; 'terry': 0.07; 'python': 0.08; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:80.91.229.12': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'received:lo.gmane.org': 0.09; 'am,': 0.14; 'wrote:': 0.14; 'columns': 0.16; 'line.split()': 0.16; 'numpy': 0.16; 'pylab': 0.16; 'reedy': 0.16; 'jan': 0.20; 'header:In-Reply-To:1': 0.21; 'trying': 0.23; 'statement': 0.26; 'subject:data': 0.26; 'import': 0.29; 'lists': 0.29; 'hi,': 0.31; 'header:X-Complaints-To:1': 0.32; 'does': 0.33; 'to:addr:python-list': 0.33; 'lines': 0.33; 'file': 0.34; 'there': 0.35; 'header:User-Agent:1': 0.35; 'file:': 0.35; 'using': 0.35; 'quite': 0.36; 'questions.': 0.37; 'received:org': 0.38; 'data': 0.38; 'subject:: ': 0.38; 'some': 0.38; 'header:Mime-Version:1': 0.39; 'to:addr:python.org': 0.39; 'really': 0.40 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Terry Reedy Subject: Re: data type and logarithm Date: Thu, 16 Jun 2011 13:20:45 -0400 References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: rain.gmane.org User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.17) Gecko/20110414 Lightning/1.0b2 Thunderbird/3.1.10 In-Reply-To: X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 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: 37 NNTP-Posting-Host: 82.94.164.166 X-Trace: 1308244860 news.xs4all.nl 49048 [::ffff:82.94.164.166]:38079 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:7755 On 6/16/2011 4:37 AM, simona bellavista wrote: > Hi, I am quite new to python and I am trying to do some simple plots. > I am using python Python 2.6.4 and numpy/1.5.1 > I have an ASCII data file that I am reading with the following lines > of code: > > import pylab > import numpy as np > > filename='something.dat' > file = open(filename) combine into one statement file = open("sjlsjls.dat") > rho = np.array([], dtype = 'float64') > entropy = np.array([], dtype = 'float64') > for line in file: > columns = line.split() r,e = line.split() > rho = np.append(rho,columns[0]) > entropy = np.append(entropy,columns[1]) rho = mp.append(rho, float(r)) # same with entropy) does numpy really not let you write Python stype rho.append(float(r)) ? There are also numpy,scipy lists for numpy,scipy questions. -- Terry Jan Reedy