reading data file into a list

Peter Otten __peter__ at web.de
Wed May 2 06:17:41 EDT 2012


ArifulHossain tuhin wrote:

> I have this data file which contains raw data in newline terminated for
> like below:
> 
> 10.6626
> 11.2683
> 11.9244
> 12.5758
> 14.1402
> 15.1636
> 
> Now i want to read that file and import this data into a numpy array. how
> should i go about it?

myarray = numpy.loadtxt(filename)




More information about the Python-list mailing list