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
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"
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@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/numpy-discussion
participants (1)
-
Sebastian Haase