[Numpy-discussion] small bug in ndarray.flatten()?

Chao YUE chaoyuejoy at gmail.com
Thu Apr 5 11:17:15 EDT 2012


nice to know this. can also use b.transpose().flatten() to circumvent it.

thanks,

Chao

2012/4/5 Pierre Haessig <pierre.haessig at crans.org>

> Hi,
>
> Le 05/04/2012 15:00, Olivier Delalleau a écrit :
> > Ok, it looks weird indeed. I was using numpy 1.6.1 myself, not sure if
> > it's a bug that's been fixed in 1.6.
> > Try without the keyword argument (b.flatten('C')), see if at least
> > that works.
>
> I can reproduce Chao's bug with my numpy 1.5.
>
> As you've just suggested, it runs fine when there is no keyword.
>
> In [1]: a= np.arange(10)
>
> In [2]: a.flatten('C') # Works well
> Out[2]: array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9])
>
> In [3]: a.flatten(order='C') # Chao's bug
> ---------------------------------------------------------------------------
> TypeError                                 Traceback (most recent call last)
> /home/pierre/<ipython-input-3-33cfe1eff84b> in <module>()
> ----> 1 a.flatten(order='C')
>
> TypeError: flatten() takes no keyword arguments
>
> In [4]: a.flatten? # indeed says there is a keyword order='C'
>
> In [5]: np.__version__
> Out[5]: '1.5.1'
>
> Now if the bug is fixed in 1.6, there's nothing more to do than just
> wait for the update !
> (Debian testing in my case)
>
> Best,
> Pierre
>
>
>
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion at scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion
>
>


-- 
***********************************************************************************
Chao YUE
Laboratoire des Sciences du Climat et de l'Environnement (LSCE-IPSL)
UMR 1572 CEA-CNRS-UVSQ
Batiment 712 - Pe 119
91191 GIF Sur YVETTE Cedex
Tel: (33) 01 69 08 29 02; Fax:01.69.08.77.16
************************************************************************************
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20120405/fed3e7c7/attachment.html>


More information about the NumPy-Discussion mailing list