[NumPy-Tickets] [NumPy] #1953: fill_diagonal fail on rectangular arrays

NumPy Trac numpy-tickets@scipy....
Sat Jun 9 09:24:48 CDT 2012


#1953: fill_diagonal fail on rectangular arrays
---------------------+------------------------------------------------------
 Reporter:  dimasad  |       Owner:  somebody   
     Type:  defect   |      Status:  new        
 Priority:  normal   |   Milestone:  Unscheduled
Component:  Other    |     Version:  devel      
 Keywords:           |  
---------------------+------------------------------------------------------

Comment(by njs):

 There's another implementation of the 2d fill_diagonal algorithm in
 numpy.lib.twodim_base.eye, and that one is both correct and more
 featureful (it lets you select off-diagonals as well). OTOH I guess it
 doesn't work for >2d arrays.

 But then, looking at the source, I guess fill_diagonal already has a
 special case for 2d arrays, and the n-d array case is mostly unimplemented
 (it only handles arrays with all dimensions equal).

 Probably we should move the implementation of np.eye into
 np.fill_diagonal, and then have np.eye call it.

-- 
Ticket URL: <http://projects.scipy.org/numpy/ticket/1953#comment:1>
NumPy <http://projects.scipy.org/numpy>
My example project


More information about the NumPy-Tickets mailing list