Re: [Numpy-discussion] Suggestion: Add the unsqueeze function to numpy

2011-04-20 Thread Yannick Copin
gmail.com> writes: > I also proposed this already once. > > However there is already function in numpy (where I have often > problems remembering the name): > > numpy.expand_dims(a, axis) Ah, thanks for the tip, I didn't know this one. The name is unfortunate indeed... Cheers, Yannick _

[Numpy-discussion] Suggestion: Add the unsqueeze function to numpy

2011-04-20 Thread Yannick Copin
(3, 5) >>> m = unsqueeze(m, 1, x.shape) >>> m.shape (3, 1, 5) """ if axis is None: return data newshape = list(oldshape) newshape[axis] = 1 return data.reshape(newshape) Cheers, -- .~. Yannick COPIN (o:>

[Numpy-discussion] Wrong behavior of atleast_3d?

2008-10-08 Thread Yannick Copin
has the correct behavior, but not atleast_3d. Cheers. -- .~. Yannick COPIN (o:>* Doctus cum libro /V\ Institut de physique nucleaire de Lyon (IN2P3 - France) // \\ Tel: (33/0) 472 431 968 AIM: YnCopin ICQ: 236931013 /( )\ h

[Numpy-discussion] Porting "IDL Astronomy User's Library" to numpy

2007-07-16 Thread Yannick Copin
e (I think) the conversion is Numeric-oriented, and because of the intrinsic differences in the function argument management between IDL and python. So, before pursuing in this direction, I'd like to know if this exercice has already been done, at least partially. Cheers. -- .~. Ya