[Numpy-discussion] numarray bug !? astype with 2d array gives transform ??

Sebastian Haase haase at msg.ucsf.edu
Mon Oct 13 09:12:03 CDT 2003


Hi all,
Could someone maybe confirm this or say that numarray 0.7 has fixed this ?
I also found more problems when type conversions are involved:  I had a 3d
stack of UInt16  data and wanted to compute the 2d-fft of different
sections -> I got identical ffts for different sections ;-(

Please help,
Sebastian Haase

----- Original Message ----- 
From: "Sebastian Haase" <haase at msg.ucsf.edu>
To: <numpy-discussion at lists.sourceforge.net>
Sent: Thursday, October 09, 2003 10:25 AM
Subject: [Numpy-discussion] numarray bug !? astype with 2d array gives
transform ??


> Hi !
> I just discovered this: (I'm using numarray 0.6 [on windows])
>
> >>> dy = na.fromfunction(lambda y,x: y, (3,3))
> >>> dx = na.fromfunction(lambda y,x: x, (3,3))
> >>> dy
> array([[0, 0, 0],
>        [1, 1, 1],
>        [2, 2, 2]])
> >>> dx
> array([[0, 1, 2],
>        [0, 1, 2],
>        [0, 1, 2]])
> >>> dx.type()
> Int32
> >>> dx.astype(na.Int8)
> array([[0, 0, 0],
>        [1, 1, 1],
>        [2, 2, 2]], type=Int8)
> >>> dx.astype(na.Int16)
> array([[0, 0, 0],
>        [1, 1, 1],
>        [2, 2, 2]], type=Int16)
> >>> dx.astype(na.Float)
> array([[ 0.,  0.,  0.],
>        [ 1.,  1.,  1.],
>        [ 2.,  2.,  2.]])
> >>> dx.astype(na.Float32)
> array([[ 0.,  0.,  0.],
>        [ 1.,  1.,  1.],
>        [ 2.,  2.,  2.]], type=Float32)
>
> What does this mean ? Am I missing something ?
>
> Thanks,
> Sebastian Haase
>
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: SF.net Giveback Program.
> SourceForge.net hosts over 70,000 Open Source Projects.
> See the people who have HELPED US provide better services:
> Click here: http://sourceforge.net/supporters.php
> _______________________________________________
> Numpy-discussion mailing list
> Numpy-discussion at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/numpy-discussion
>





More information about the Numpy-discussion mailing list