Re: [Numpy-discussion] The NumPy Mandelbrot code 16x slower than Fortran

2012-01-25 Thread Ondřej Čertík
On Tue, Jan 24, 2012 at 4:33 PM, Mark Wiebe wrote: > 2012/1/21 Ondřej Čertík >> >> >> >> >> Let me know if you figure out something. I think the "mask" thing is >> quite slow, but the problem is that it needs to be there, to catch >> overflows (and it is there in Fortran as well, see the >> "whe

Re: [Numpy-discussion] view of a structured array?

2012-01-25 Thread Chris Barker
On Wed, Jan 25, 2012 at 11:33 AM, wrote: > that's what I would try: > b = a.view(dtype=[('i', '>>> ('i2', '>>> b['fl'] > array([(2.0, 3.0), (8.0, 9.0), (123.41, 7.0), (10.0, 11.0), >       (14.0, 15.0)], >      dtype=[('f1', '>>> b['fl'][2]= (200, 500) a > array([(1, 2.0, 3.

Re: [Numpy-discussion] Unexpected behavior with np.min_scalar_type

2012-01-25 Thread Kathleen M Tacina
Thanks! It was interesting to see why that happened. Kathy On Tue, 2012-01-24 at 18:56 -0600, Mark Wiebe wrote: > On Tue, Jan 24, 2012 at 7:29 AM, Kathleen M Tacina > wrote: > > I was experimenting with np.min_scalar_type to make sure it > worked as expected, and found some u

Re: [Numpy-discussion] view of a structured array?

2012-01-25 Thread josef . pktd
On Wed, Jan 25, 2012 at 2:27 PM, Chris Barker wrote: > HI folks, > > Is there a way to get a view of a subset of a structured array? I know > that an arbitrary subset will not fit into the numpy "strides"offsets" > model, but some will, and it would be nice to have a view: > > For example, here we

[Numpy-discussion] view of a structured array?

2012-01-25 Thread Chris Barker
HI folks, Is there a way to get a view of a subset of a structured array? I know that an arbitrary subset will not fit into the numpy "strides"offsets" model, but some will, and it would be nice to have a view: For example, here we have a stuctured array: In [56]: a Out[56]: array([(1, 2.0, 3.0,

Re: [Numpy-discussion] array metadata

2012-01-25 Thread Val Kalatsky
I believe there are no provisions made for that in ndarray. But you can subclass ndarray. Val On Wed, Jan 25, 2012 at 12:10 PM, Emmanuel Mayssat wrote: > Is there a way to store metadata for an array? > For example, date the samples were collected, name of the operator, etc. > > Regards, > -- > E

[Numpy-discussion] array metadata

2012-01-25 Thread Emmanuel Mayssat
Is there a way to store metadata for an array? For example, date the samples were collected, name of the operator, etc. Regards, -- Emmanuel ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discuss

[Numpy-discussion] Matplotlib and optimization tutorials at PyCon US

2012-01-25 Thread Mike Müller
Hi, I will be giving a matplotlib and a optimization tutorial at PyCon in March. The first tutorial is a compact introduction to matplotlib. The optimization tutorial gives an overview over this topic. BTW, the early bird deadline is today. Mike Plotting with matplotlib

Re: [Numpy-discussion] Permuting sparse arrays

2012-01-25 Thread Robert Kern
On Wed, Jan 25, 2012 at 15:12, Edward C. Jones wrote: > I have a vector of bits where there are many more zeros than one.  I > store the array as a sorted list of the indexes where the bit is one. > If the bit array is (0, 1, 0, 0, 0, 1, 1), it is stored as (1, 5, 6). > If the bit array, b, has le

[Numpy-discussion] Permuting sparse arrays

2012-01-25 Thread Edward C. Jones
I have a vector of bits where there are many more zeros than one. I store the array as a sorted list of the indexes where the bit is one. If the bit array is (0, 1, 0, 0, 0, 1, 1), it is stored as (1, 5, 6). If the bit array, b, has length n, and p is a random permutation of arange(n), then

Re: [Numpy-discussion] advanced indexing bug with huge arrays?

2012-01-25 Thread Charles R Harris
On Tue, Jan 24, 2012 at 3:30 PM, David Warde-Farley < warde...@iro.umontreal.ca> wrote: > On Tue, Jan 24, 2012 at 01:02:44PM -0500, David Warde-Farley wrote: > > On Tue, Jan 24, 2012 at 06:37:12PM +0100, Robin wrote: > > > > > Yes - I get exactly the same numbers in 64 bit windows with 1.6.1. > >

Re: [Numpy-discussion] advanced indexing bug with huge arrays?

2012-01-25 Thread Sturla Molden
On 24.01.2012 23:30, David Warde-Farley wrote: > I've figured it out. In numpy/core/src/multiarray/mapping.c, PyArray_GetMap > is using an int for a counter variable where it should be using an npy_intp. > > I've filed a pull request at https://github.com/numpy/numpy/pull/188 with a > regression t