Re: [Numpy-discussion] tofile speed

2007-07-25 Thread Lars Friedrich
Hello, I tried the following: ### start code a = N.random.rand(100) myFile = file('test.bin', 'wb') for i in range(100): a.tofile(myFile) myFile.close() ### end code And this gives roughly 50 MB/s on my office-machine but only 6.5 MB/s on the machine that I was

Re: [Numpy-discussion] Compile extension modules with Visual Studio 2005

2007-07-25 Thread Ray Schumacher
Geoffrey Zhu wrote: Hi, I am about to write a C extension module. C functions in the module will take and return numpy arrays. I found a tutorial online, but I am not sure about the following: I agree with others that ctypes might be your best path. The codeGenerator is magic, if you

Re: [Numpy-discussion] Compile extension modules with Visual Studio 2005

2007-07-25 Thread Gael Varoquaux
On Wed, Jul 25, 2007 at 06:38:55AM -0700, Ray Schumacher wrote: The codeGenerator is magic, if you ask me: http://starship.python.net/crew/theller/ctypes/old/codegen.html Can it wrap code passing around arrays ? If so it really does magic that I don't understand. Gaƫl

Re: [Numpy-discussion] Compile extension modules with Visual Studio 2005

2007-07-25 Thread Stefan van der Walt
On Wed, Jul 25, 2007 at 03:41:37PM +0200, Gael Varoquaux wrote: On Wed, Jul 25, 2007 at 06:38:55AM -0700, Ray Schumacher wrote: The codeGenerator is magic, if you ask me: http://starship.python.net/crew/theller/ctypes/old/codegen.html Can it wrap code passing around arrays ? If so it

Re: [Numpy-discussion] tofile speed

2007-07-25 Thread Charles R Harris
On 7/25/07, Lars Friedrich [EMAIL PROTECTED] wrote: Hello, I tried the following: ### start code a = N.random.rand(100) myFile = file('test.bin', 'wb') for i in range(100): a.tofile(myFile) myFile.close() ### end code And this gives roughly 50 MB/s on my

Re: [Numpy-discussion] Compile extension modules with Visual Studio 2005

2007-07-25 Thread Gael Varoquaux
On Wed, Jul 25, 2007 at 04:44:08PM +0200, Stefan van der Walt wrote: On Wed, Jul 25, 2007 at 03:41:37PM +0200, Gael Varoquaux wrote: On Wed, Jul 25, 2007 at 06:38:55AM -0700, Ray Schumacher wrote: The codeGenerator is magic, if you ask me:

[Numpy-discussion] Change to get_printoptions?

2007-07-25 Thread Zachary Pincus
Hello all, I just recently updated to the SVN version of numpy to test my code against it, and found that a small change made to numpy.get_printoptions (it now returns a dictionary instead of a list) breaks my code. Here's the changeset: http://projects.scipy.org/scipy/numpy/changeset/3877

Re: [Numpy-discussion] output arguments

2007-07-25 Thread Thomas Breuel
For example, it would be nice if outer supported: outer(b,c,output=a) outer(b,c,increment=a) outer(b,c,increment=a,scale=eps) or maybe one could specify an accumulation ufunc, with addition, multiplication, min, and max being fast, and with an optional scale parameter. What would the

Re: [Numpy-discussion] Compile extension modules with Visual Studio 2005

2007-07-25 Thread Chris Barker
Ray Schumacher wrote: I agree with others that ctypes might be your best path. Pyrex is a good bet too: http://www.scipy.org/Cookbook/Pyrex_and_NumPy The advantage with pyrex is that you don't have to write any C at all. You will have to use a compiler that is compatible with your Python

Re: [Numpy-discussion] Compile extension modules with Visual Studio 2005

2007-07-25 Thread David Cournapeau
Gael Varoquaux wrote: On Wed, Jul 25, 2007 at 04:44:08PM +0200, Stefan van der Walt wrote: On Wed, Jul 25, 2007 at 03:41:37PM +0200, Gael Varoquaux wrote: On Wed, Jul 25, 2007 at 06:38:55AM -0700, Ray Schumacher wrote: The codeGenerator is magic, if you ask me:

Re: [Numpy-discussion] Should I use numpy array?

2007-07-25 Thread Robert Kern
Geoffrey Zhu wrote: Hi, I am writing a function that would take a list of datetime objects and a list of single letter characters (such as [A,B,C]). The number of items tend to be big and both the list and the numpy array have all the functionalities I need. Do you think I should use

[Numpy-discussion] Should I use numpy array?

2007-07-25 Thread Geoffrey Zhu
Hi, I am writing a function that would take a list of datetime objects and a list of single letter characters (such as [A,B,C]). The number of items tend to be big and both the list and the numpy array have all the functionalities I need. Do you think I should use numpy arrays or the regular