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
_
(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:>
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
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