[Numpy-tickets] [NumPy] #532: Invalid numpy.trace docstring

NumPy numpy-tickets@scipy....
Fri Jun 1 03:51:07 CDT 2007

#532: Invalid numpy.trace docstring
 Reporter:  pv      |       Owner:  somebody
     Type:  defect  |      Status:  new     
 Priority:  normal  |   Milestone:          
Component:  Other   |     Version:  none    
 Severity:  normal  |    Keywords:          
 The numpy.trace docstring is invalid, trace actually sums over the
 diagonal in the '''first''' two axes by default:

 import numpy as N
 print N.__version__
 x = N.zeros((4,4,5,6))
 print N.trace(x).shape
 x = N.zeros((5,6,4,4))
 print N.trace(x).shape
  trace(a, offset=0, axis1=0, axis2=1, dtype=None, out=None)

 trace(a,offset=0, axis1=0, axis2=1) returns the sum along diagonals
 (defined by the last two dimenions) of the array.
 (5, 6)
 (4, 4)

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

More information about the Numpy-tickets mailing list