Re: [Numpy-discussion] Read array from file

2008-03-17 Thread Christopher Barker
lorenzo bolla wrote: > what about numpy.loadtxt? or, probably faster, the little-known (it seems) numpy.fromfile() text mode: # Read and write the first information lines for i in range(0,5): Fdif.write( Fpst.readline() ) # Read and write coordinates coords =numpy.fromfile(Fpst,

Re: [Numpy-discussion] Read array from file

2008-03-16 Thread Gael Varoquaux
On Fri, Mar 14, 2008 at 07:42:07PM -0300, Lisandro Dalcin wrote: > If you just want to manage VTK files, the you have to definitely try > pyvtk. http://cens.ioc.ee/projects/pyvtk/ > I have a similar numpy-based but independent implementation, not fully > tested, targeted to only write VTK files fo

Re: [Numpy-discussion] Read array from file

2008-03-14 Thread Lisandro Dalcin
If you just want to manage VTK files, the you have to definitely try pyvtk. http://cens.ioc.ee/projects/pyvtk/ I have a similar numpy-based but independent implementation, not fully tested, targeted to only write VTK files for big datasets (let say, more than 1 millon nodes) in eider ascii or byna

Re: [Numpy-discussion] Read array from file

2008-03-14 Thread lorenzo bolla
what about numpy.loadtxt? In [9]: numpy.loadtxt('test.dat', skiprows=5) Out[9]: array([[ 15.44261, 12.05814, 54.43124], [ 15.54899, 12.00075, 53.85503], [ 15.95802, 11.92959, 53.88939], [ 15.84085, 12.00235, 54.43274], [ 15.53889, 11.16645, 54.51649], [

[Numpy-discussion] Read array from file

2008-03-14 Thread Dimitrios Kiousis
Hello python users, I have an input file consisting of string-lines and float-lines. This is how it looks: # vtk DataFile Version 3.0 VTK file exported from FEAP ASCII DATASET UNSTRUCTURED_GRID POINTS6935 FLOAT 15.44261 12.05814 54.43124 15.54899 12.00075 53.85503 15.95802 11