Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #7755
| 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 | <python-python-list@m.gmane.org> |
| 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 <tjreedy@udel.edu> |
| Subject | Re: data type and logarithm |
| Date | Thu, 16 Jun 2011 13:20:45 -0400 |
| References | <b583dac8-826e-4bd5-b230-00e667855896@m24g2000yqc.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 | 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 | <b583dac8-826e-4bd5-b230-00e667855896@m24g2000yqc.googlegroups.com> |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.12 |
| Precedence | list |
| List-Id | General discussion list for the Python programming language <python-list.python.org> |
| List-Unsubscribe | <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe> |
| List-Archive | <http://mail.python.org/pipermail/python-list> |
| List-Post | <mailto:python-list@python.org> |
| List-Help | <mailto:python-list-request@python.org?subject=help> |
| List-Subscribe | <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.25.1308244859.1164.python-list@python.org> (permalink) |
| 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 |
Show key headers only | View raw
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
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
data type and logarithm simona bellavista <afylot@gmail.com> - 2011-06-16 01:37 -0700
Re: data type and logarithm Nobody <nobody@nowhere.com> - 2011-06-16 10:16 +0100
Re: data type and logarithm "afylot@gmail.com" <antonella.garzilli@gmail.com> - 2011-06-16 02:27 -0700
Re: data type and logarithm Peter Otten <__peter__@web.de> - 2011-06-16 13:55 +0200
Re: data type and logarithm Terry Reedy <tjreedy@udel.edu> - 2011-06-16 13:20 -0400
Re: data type and logarithm Robert Kern <robert.kern@gmail.com> - 2011-06-16 16:21 -0500
csiph-web