[Numpy-discussion] How to import input data to make ndarray for batch processing?

2010-11-18 Thread Venkat
Hi All, I am new to Numpy (also Scipy). I am trying to reshape my text data which is in one single column (10,000 rows). I want the data to be in 100x100 array form. I have many files to convert like this. All of them are having file names like 0, 1, 2, 500. with out any extension. Actually,

Re: [Numpy-discussion] How to import input data to make ndarray for batch processing?

2010-11-18 Thread Nadav Horesh
Do you want to save the file to disk as 100x100 matrices, or just to read them into the memory? Are the files in ascii or binary format? Nadav From: numpy-discussion-boun...@scipy.org [numpy-discussion-boun...@scipy.org] On Behalf Of Venkat

Re: [Numpy-discussion] How to import input data to make ndarray for batch processing?

2010-11-18 Thread Fabrice Silva
El jeu., 18-11-2010 a las 20:19 +0530, Venkat escribió: I have many files to convert like this. All of them are having file names like 0, 1, 2, 500. with out any extension. Actually, I renamed actual files so that I can import them in Matlab for batch processing. Since Matlab also new for

Re: [Numpy-discussion] How to import input data to make ndarray for batch processing?

2010-11-18 Thread Christopher Barker
On 11/18/10 7:40 AM, Dave Hirschfeld wrote: In [7]: data = np.loadtxt('dummy_data.txt') or, faster: data = np.fromfile('dummy_data.txt', dtype=np.float64, sep = ' ') fromfile() is not very flexible, and doesn't have good error handling, but it's a lot faster than loadtxt for the simple cases

Re: [Numpy-discussion] How to import input data to make ndarray for batch processing?

2010-11-18 Thread Lutz Maibaum
On Nov 18, 2010, at 6:49 AM, Venkat wrote: I am trying to reshape my text data which is in one single column (10,000 rows). I want the data to be in 100x100 array form. If all you want to do is converting the actual files, and you are using a unix-ish operating system, you don't even need