Re: [Numpy-discussion] NumPy 1.0 release-candidate 1.0 this weekend

2006-09-14 Thread Andrew Straw
Travis Oliphant wrote: > Sebastian Haase wrote: > >> Travis Oliphant wrote: >> >> >> >>> It's not necessarily dead, the problem is complexity of implementation >>> and more clarity about how all dtypes are supposed to be printed, not >>> just this particular example. A patch would be

Re: [Numpy-discussion] In-place operations

2006-09-14 Thread Pierre Thibault
On 9/13/06, Francesc Altet <[EMAIL PROTECTED]> wrote: > Well, it seems that malloc actually takes more time when asking for more > space. However, this can't be the reason why Pierre is seeing that: > > a = numpy.exp(a) [1] > > is slower than > > numpy.exp(a,out=a) [2] > > as I'd say that this in

[Numpy-discussion] `_import_array' defined but not used

2006-09-14 Thread Martin Wiechert
Hi gurus, I'm debugging a C-extension module that uses numpy. My version is 1.0b1. Can I safely ignore the following compiler warning? .../lib/python2.4/site-packages/numpy/core/include/numpy/__multiarray_api.h:903: warning: `_import_array' defined but not used Any help would be appreciated.

Re: [Numpy-discussion] NumPy 1.0 release-candidate 1.0 this weekend

2006-09-14 Thread Francesc Altet
El dj 14 de 09 del 2006 a les 02:11 -0700, en/na Andrew Straw va escriure: > >> My main focus is on the fact that you might read ' >> "less" than 4-bytes int, which is very confusing ! > >> > >> > > I can agree it's confusing at first, but it's the same syntax the struct > > module uses wh

Re: [Numpy-discussion] NumPy 1.0 release-candidate 1.0 this weekend

2006-09-14 Thread Victoria G. Laidler
Francesc Altet wrote: >El dj 14 de 09 del 2006 a les 02:11 -0700, en/na Andrew Straw va >escriure: > > My main focus is on the fact that you might read '>>>"less" than 4-bytes int, which is very confusing ! >>>I can agree it's confusing at first, but it's th

Re: [Numpy-discussion] NumPy 1.0 release-candidate 1.0 this weekend

2006-09-14 Thread Charles R Harris
On 9/14/06, Victoria G. Laidler <[EMAIL PROTECTED]> wrote: Francesc Altet wrote:>El dj 14 de 09 del 2006 a les 02:11 -0700, en/na Andrew Straw va>escriure:>>My main focus is on the fact that you might read '"less" than 4-bytes int, which is very confusing ! >>>I can agree it

Re: [Numpy-discussion] Problem with concatenate and object arrays

2006-09-14 Thread Christopher Barker
Charles R Harris wrote: >> > Why not simply >> > write a wrapper function in python that does Numeric-style guesswork, >> > and put it in the compatibility modules? >> Can I encourage any more comments? +1 > The main problem in constructing arrays > of objects is more information needs to be s

Re: [Numpy-discussion] Avoiding array-scalar arithmetic?

2006-09-14 Thread Ryan Gutenkunst
Hi Travis, Travis Oliphant wrote: > Ryan Gutenkunst wrote: >> I notice that numpy_array.item() will give me the first element as a >> normal scalar. Would it be possible for numpy_array.item(N) to return >> the Nth element of the array as a normal scalar? >> > Now this is an interesting idea.

Re: [Numpy-discussion] Avoiding array-scalar arithmetic?

2006-09-14 Thread Travis Oliphant
Ryan Gutenkunst wrote: >Hi Travis, > >Travis Oliphant wrote: > > >>Ryan Gutenkunst wrote: >> >> >>>I notice that numpy_array.item() will give me the first element as a >>>normal scalar. Would it be possible for numpy_array.item(N) to return >>>the Nth element of the array as a normal scala

[Numpy-discussion] Experience with Visit?

2006-09-14 Thread Travis Oliphant
Has anybody had any experience with the 3-D visualization software VISIT? It has Python bindings and seems to be pretty sophisticated. I'm wondering why I haven't heard more about it. http://www.llnl.gov/visit/ -Travis --

[Numpy-discussion] Axis Iterator?

2006-09-14 Thread Brendan Simons
Hi all, Just wondering if there was an arbitrary axis iterator in numpy, or if not, if there's demand for one. What I'm looking for is something which would allow me to do something like (vectorFunc(column) for column in array.axisIter(1) ) without a bunch of for loops and slicing. Thoug

Re: [Numpy-discussion] Axis Iterator?

2006-09-14 Thread Travis Oliphant
Brendan Simons wrote: >Hi all, > >Just wondering if there was an arbitrary axis iterator in numpy, or >if not, if there's demand for one. What I'm looking for is something >which would allow me to do something like (vectorFunc(column) for >column in array.axisIter(1) ) without a bunch of

Re: [Numpy-discussion] Axis Iterator?

2006-09-14 Thread Bill Baxter
Iteration over axis 0 is built-in, so you can already do (vectorFunc(row) for row in array) And you can use transpose() to make it so the axis you want to iterate over is axis 0. (vectorFunc(col) for col in array.transpose(1,0)) Or just use the .T attribute (vectorFunc(col) for col in a

Re: [Numpy-discussion] Avoiding array-scalar arithmetic?

2006-09-14 Thread Ryan Gutenkunst
Travis, Thanks for the quick response. My application is back up to its old speed. Thanks also for spearheading the numpy/scipy projects. It's certainly made my work much, much more productive. Cheers, Ryan On Sep 14, 2006, at 7:40 PM, Travis Oliphant wrote: > Ryan Gutenkunst wrote: >> Thanks

Re: [Numpy-discussion] Axis Iterator?

2006-09-14 Thread Tim Hochberg
Bill Baxter wrote: > Iteration over axis 0 is built-in, so you can already do > (vectorFunc(row) for row in array) > And you can use transpose() to make it so the axis you want to iterate > over is axis 0. > (vectorFunc(col) for col in array.transpose(1,0)) > Or just use the .T attribute >

[Numpy-discussion] how to get info about internals of an array object ?

2006-09-14 Thread Sebastian Haase
Hi, what I'm asking is if numpy has an equivalent to numarray's info() function: >>> na.arange(10).info() class: shape: (10,) strides: (4,) byteoffset: 0 bytestride: 4 itemsize: 4 aligned: 1 contiguous: 1 buffer: data pointer: 0x085b7ec8 (DEBUG ONLY) byteorder: 'little' byteswap: 0 type: Int32 T

Re: [Numpy-discussion] Axis Iterator?

2006-09-14 Thread Bill Baxter
On 9/15/06, Tim Hochberg <[EMAIL PROTECTED]> wrote: > Isn't swapaxis appropriate for this? In other words: > You're right. Just didn't think of that. Never used swapaxes before. def axisiter(arr, i): return arr.swapaxes(0,i) --bb ---

Re: [Numpy-discussion] Axis Iterator?

2006-09-14 Thread Brendan Simons
Oh that's cool.  For some reason I thought that the built in iterator (for i in array) iterated over cells, not the first axis.  I also didn't think about swapaxes.    Is there any desire to add a convenience function or method as follows?def axisIter(selfOrArr, i): return iter(selfOrArr.swapAxes(0

Re: [Numpy-discussion] how to get info about internals of an array object ?

2006-09-14 Thread Francesc Altet
El dj 14 de 09 del 2006 a les 18:20 -0700, en/na Sebastian Haase va escriure: > Especially I'm asking if there is any way to get the memory address of an > array - for debugging purposes only - of course ;-) For this, you can print the data buffer: In [1]:import numpy In [2]:a=numpy.array([1])