[Numpy-tickets] [NumPy] #657: x.flat[:] interprets non-native byteorder arrays incorrectly

NumPy numpy-tickets@scipy....
Mon Feb 11 14:43:05 CST 2008


#657: x.flat[:] interprets non-native byteorder arrays incorrectly
------------------------+---------------------------------------------------
 Reporter:  rkern       |       Owner:  somebody
     Type:  defect      |      Status:  new     
 Priority:  normal      |   Milestone:  1.0.5   
Component:  numpy.core  |     Version:  devel   
 Severity:  major       |    Keywords:          
------------------------+---------------------------------------------------
 {{{

 In [9]: from numpy import *

 In [10]: import sys

 In [11]: sys.byteorder
 Out[11]: 'little'

 In [12]: arange(10).astype('>i4')
 Out[12]: array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9])

 In [13]: arange(10).astype('>i4').flat[:]
 Out[13]:
 array([        0,  16777216,  33554432,  50331648,  67108864,  83886080,
        100663296, 117440512, 134217728, 150994944])

 In [14]: arange(10).astype('>f8')
 Out[14]: array([ 0.,  1.,  2.,  3.,  4.,  5.,  6.,  7.,  8.,  9.])

 In [15]: arange(10).astype('>f8').flat[:]
 Out[15]:
 array([  0.00000000e+000,   3.03865194e-319,   3.16202013e-322,
          1.04346664e-320,   2.05531309e-320,   2.56123631e-320,
          3.06715953e-320,   3.57308275e-320,   4.07900597e-320,
          4.33196758e-320])
 }}}

-- 
Ticket URL: <http://scipy.org/scipy/numpy/ticket/657>
NumPy <http://projects.scipy.org/scipy/numpy>
The fundamental package needed for scientific computing with Python.


More information about the Numpy-tickets mailing list