[NumPy-Tickets] [NumPy] #1746: array(), asarray() fail

NumPy Trac numpy-tickets@scipy....
Fri Feb 18 17:10:52 CST 2011


#1746: array(), asarray() fail
----------------------------+-----------------------------------------------
 Reporter:  pa.basso        |       Owner:  somebody
     Type:  defect          |      Status:  new     
 Priority:  normal          |   Milestone:  2.0.0   
Component:  Other           |     Version:  1.5.1   
 Keywords:  array, asarray  |  
----------------------------+-----------------------------------------------
 I can't make a numpy array with this list:

 mtx=[[ 0.,  0.,  0.], [ 0., -1., -2.], [ 1.,  1.,  1.]]

 A=np.array(mtx)  # doesn't work
 A=np.asarray(mtx)  # doesn't work

 both return me the following warnings:

 Warning: invalid value encountered in double_scalars
 Warning: invalid value encountered in double_scalars
 Warning: invalid value encountered in double_scalars
 Warning: divide by zero encountered in double_scalars
 Warning: invalid value encountered in double_scalars
 Warning: invalid value encountered in double_scalars
 Warning: invalid value encountered in double_scalars
 Warning: invalid value encountered in double_scalars

 And at the end...
 A =
 [[ nan  nan  nan]
  [ nan  nan  nan]
  [ nan  nan  nan]]

 If I try instead:

 A=np.asmatrix(mtx) # this works!!

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


More information about the NumPy-Tickets mailing list