[NumPy-Tickets] [NumPy] #2141: numpy.round() doesn't work on zero dimensional vectors or floats

NumPy Trac numpy-tickets@scipy....
Wed May 23 03:05:55 CDT 2012


#2141: numpy.round() doesn't work on zero dimensional vectors or floats
------------------------+---------------------------------------------------
 Reporter:  pbrod       |       Owner:  somebody
     Type:  defect      |      Status:  new     
 Priority:  normal      |   Milestone:  1.8.0   
Component:  numpy.core  |     Version:  1.6.1   
 Keywords:              |  
------------------------+---------------------------------------------------
 as shown in the following example:
 {{{
 In [12]: np.__version__
 Out[12]: '1.6.1'

 In [13]: np.round(3.434523, decimals=3)
 Out[13]: 3.4350000000000001

 In [14]: np.round(np.array(3.434523), decimals=3)
 Out[14]: 3.4350000000000001
 }}}

 However, correct result is obtained when the value is converted to a one
 dimensional array, as shown here:
 {{{
 In [15]: np.round([3.434523], decimals=3)
 Out[15]: array([ 3.435])


 In [16]: np.round(np.array([3.434523]), decimals=3)
 Out[16]: array([ 3.435])
 }}}

 A related issue is Ticket #1648

-- 
Ticket URL: <http://projects.scipy.org/numpy/ticket/2141>
NumPy <http://projects.scipy.org/numpy>
My example project


More information about the NumPy-Tickets mailing list