Re: [Numpy-discussion] defmatrix move - new docstrings disappeared

2009-09-17 Thread Scott Sinclair
> 2009/9/17 Pauli Virtanen : > to, 2009-09-17 kello 18:19 +0200, Scott Sinclair kirjoitti: > [clip] >> It's probably important that the documentation patches should be >> committed pretty soon after being reviewed for obvious malicious code >> and marked "OK to Apply". It's possible to edit docstri

Re: [Numpy-discussion] defmatrix move - new docstrings disappeared

2009-09-17 Thread Ralf Gommers
There is a lot more it turns out: atleast_1d atleast_2d atleast_3d hstack vstack correlate2 linspace logspace finfo iinfo MachAr Based on this I suspect there is quite a bit of work that got lost earlier in the summer. A couple of times I saw the count of "needs editing" in the stats go up by se

Re: [Numpy-discussion] dumb structured arrays question

2009-09-17 Thread David Warde-Farley
On 17-Sep-09, at 6:18 PM, Erin Sheldon wrote: > > You can just view it differently: > > In [4]: x=numpy.zeros(3,dtype=[('field1','S5'),('field2','f4'), > ('field3','f4'),('field4','f4')]) > > In [5]: x > Out[5]: > array([('', 0.0, 0.0, 0.0), ('', 0.0, 0.0, 0.0), ('', 0.0, 0.0, 0.0)], > dtype

Re: [Numpy-discussion] dumb structured arrays question

2009-09-17 Thread Erin Sheldon
On Thu, Sep 17, 2009 at 6:12 PM, David Warde-Farley wrote: > If I have a 1-dimensional array with a structured dtype, say str, > float, float, float, float where all the float columns have their > own names, and I just want to extract all the floats in the order they > appear into a 2D matrix

[Numpy-discussion] dumb structured arrays question

2009-09-17 Thread David Warde-Farley
If I have a 1-dimensional array with a structured dtype, say str, float, float, float, float where all the float columns have their own names, and I just want to extract all the floats in the order they appear into a 2D matrix that disregards the dtype metadata... Is there an easy way t

Re: [Numpy-discussion] Efficient array equivalent to cmp(x,y)

2009-09-17 Thread Kim Hansen
> > > > In [1]: a = np.array([0, 2, 4, 1, 3, 0, 3, 4, 0, 1]) > > In [2]: lim = 2 > > In [3]: np.sign(a - lim) > Out[3]: array([-1, 0, 1, -1, 1, -1, 1, 1, -1, -1]) > Dooh. Facepalm. I should have thought of that myself! Only one intermediate array needs to be created then. Thank you. That was

Re: [Numpy-discussion] Efficient array equivalent to cmp(x,y)

2009-09-17 Thread Kim Hansen
> > > > If there are no NaNs, you only need to make 2 masks by using ones > instead of empty. Not elegent but a little faster. > Good point! Thanks. ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy

Re: [Numpy-discussion] Efficient array equivalent to cmp(x,y)

2009-09-17 Thread Robert Kern
[Please pardon the piggybacking. I didn't get the original.] On Thu, Sep 17, 2009 at 15:19, Keith Goodman wrote: > On Thu, Sep 17, 2009 at 1:13 PM, Kim Hansen wrote: >> Hi, >> >> Is there an array-like function equivalent with the builtin method for the >> Python single-valued comparison cmp(x,y

Re: [Numpy-discussion] Efficient array equivalent to cmp(x,y)

2009-09-17 Thread Keith Goodman
On Thu, Sep 17, 2009 at 1:13 PM, Kim Hansen wrote: > Hi, > > Is there an array-like function equivalent with the builtin method for the > Python single-valued comparison cmp(x,y)? > > What I would like is a cmp(a, lim), where a is an ndarray and lim is a > single value, and then I need an array ba

[Numpy-discussion] Efficient array equivalent to cmp(x,y)

2009-09-17 Thread Kim Hansen
Hi, Is there an array-like function equivalent with the builtin method for the Python single-valued comparison cmp(x,y)? What I would like is a cmp(a, lim), where a is an ndarray and lim is a single value, and then I need an array back of a's shape giving the elementwise comparison array([cmp(a[0

Re: [Numpy-discussion] defmatrix move - new docstrings disappeared

2009-09-17 Thread Ralf Gommers
On Thu, Sep 17, 2009 at 1:48 PM, Pauli Virtanen wrote: > to, 2009-09-17 kello 11:21 -0400, Ralf Gommers kirjoitti: > > After the recent move of the matrix module, all the changes to the > > docstrings have disappeared from the doc wiki. I imagine the changes > > still live somewhere in the underl

Re: [Numpy-discussion] matlab for numpy users

2009-09-17 Thread David Warde-Farley
On 17-Sep-09, at 2:41 AM, David Cournapeau wrote: > Not really (except for trivial things like scalar-matrix operations). > The usual way to do it in matlab is repmat, which helps you doing > 'manual broadcasting'. In recent versions there is also 'bsxfun', which is an awkward way of doing bro

Re: [Numpy-discussion] defmatrix move - new docstrings disappeared

2009-09-17 Thread Pauli Virtanen
to, 2009-09-17 kello 18:19 +0200, Scott Sinclair kirjoitti: [clip] > It's probably important that the documentation patches should be > committed pretty soon after being reviewed for obvious malicious code > and marked "OK to Apply". It's possible to edit docstrings that are > marked as "OK to appl

Re: [Numpy-discussion] defmatrix move - new docstrings disappeared

2009-09-17 Thread Pauli Virtanen
to, 2009-09-17 kello 11:21 -0400, Ralf Gommers kirjoitti: > After the recent move of the matrix module, all the changes to the > docstrings have disappeared from the doc wiki. I imagine the changes > still live somewhere in the underlying repo but are not visible to the > user. Can they be restored

Re: [Numpy-discussion] Simple pattern recognition

2009-09-17 Thread Gökhan Sever
On Thu, Sep 17, 2009 at 10:14 AM, Gökhan Sever wrote: > > I use PIL to read my png file (after cropped the initial image to the > column of my interest) Like: > > from PIL import Image > myim = Image('seccol.png) > imdata = np.array(myim.getdata()) > > From this on, I am not sure what to provide t

Re: [Numpy-discussion] defmatrix move - new docstrings disappeared

2009-09-17 Thread Ralf Gommers
On Thu, Sep 17, 2009 at 12:19 PM, Scott Sinclair wrote: > > 2009/9/17 Ralf Gommers : > > After the recent move of the matrix module, all the changes to the > docstrings have disappeared from the doc wiki. > > Hmm.. http://article.gmane.org/gmane.comp.python.scientific.devel/9732 ;-) > > > > I kn

Re: [Numpy-discussion] datetime-related import slowdown

2009-09-17 Thread Travis Oliphant
On Sep 7, 2009, at 2:57 AM, David Cournapeau wrote: > Hi, > >I noticed that numpy import times significantly are significantly > worse than it used to be, and those are related to recent datetime > related changes: > > # One month ago > time python -c "import numpy" -> 141ms > > # Now: > time

Re: [Numpy-discussion] defmatrix move - new docstrings disappeared

2009-09-17 Thread Scott Sinclair
> 2009/9/17 Ralf Gommers : > After the recent move of the matrix module, all the changes to the docstrings > have disappeared from the doc wiki. Hmm.. http://article.gmane.org/gmane.comp.python.scientific.devel/9732 ;-) > I know it is quite a bit of work to do the merge. I remember Pauli saying

[Numpy-discussion] defmatrix move - new docstrings disappeared

2009-09-17 Thread Ralf Gommers
Hi, After the recent move of the matrix module, all the changes to the docstrings have disappeared from the doc wiki. I imagine the changes still live somewhere in the underlying repo but are not visible to the user. Can they be restored? If there is some unforeseen problem with that, I do have a

Re: [Numpy-discussion] [Matplotlib-users] Simple pattern recognition

2009-09-17 Thread Gökhan Sever
On Wed, Sep 16, 2009 at 10:46 PM, Tony S Yu wrote: > > On Sep 16, 2009, at 8:22 PM, Gökhan Sever wrote: > > Hello all, > > I want to be able to count predefined simple rectangle shapes on an image > as shown like in this one: > http://img7.imageshack.us/img7/2327/particles.png > > Which is in my

Re: [Numpy-discussion] Simple pattern recognition

2009-09-17 Thread Gökhan Sever
On Wed, Sep 16, 2009 at 7:53 PM, Alan G Isaac wrote: > On 9/16/2009 8:22 PM, Gökhan Sever wrote: > > I want to be able to count predefined simple rectangle shapes on an > > image as shown like in this one: > > http://img7.imageshack.us/img7/2327/particles.png > > ch.9 of > http://www.amazon.com/B

Re: [Numpy-discussion] Simple pattern recognition

2009-09-17 Thread Gökhan Sever
On Wed, Sep 16, 2009 at 8:43 PM, David Warde-Farley wrote: > On 16-Sep-09, at 8:22 PM, Gökhan Sever wrote: > > > Hello all, > > > > I want to be able to count predefined simple rectangle shapes on an > > image as > > shown like in this one: > http://img7.imageshack.us/img7/2327/particles.png > > >

Re: [Numpy-discussion] matlab for numpy users

2009-09-17 Thread Sturla Molden
Christian K. skrev: > Is there something like broadcasting in matlab? Matlab does not do automatic broadcasting like NumPy and Fortran 95. You have to broadcast manually, mostly using repmat (but there are other ways as well). This should help: http://home.online.no/~pjacklam/matlab/doc/mtt/doc

Re: [Numpy-discussion] matlab for numpy users

2009-09-17 Thread David Cournapeau
Hi Christian, Christian K. wrote: > Hi, > > this is probaby an unusual question here from someone used to numpy who is > forced to work with matlab and it is not exactly the right place to ask. > Sorry > for that. > > Is there something like broadcasting in matlab? Not really (except for triv