[Numpy-discussion] documentation error
Alan G Isaac
aisaac at american.edu
Tue Oct 12 07:03:18 CDT 2004
> On Sun, 2004-10-10 at 11:33, Alan G Isaac wrote:
>> In the Numeric manual, there are two different defintions of the
>> 'diagonal' function. The second definition appears to be incorrect.
On Mon, 11 Oct 2004, Stephen Walton apparently wrote:
> Are you sure? On my system, it appears that the second definition is
> correct in both Numeric 23.3 and numarray 1.1.
You did not quote the problematic portion:
The diagonal function takes an array a, and returns
an array of rank 1 ... With the default values, this
corresponds to all of the elements of the diagonal
of a along the last two axes.
Contrast:
>>> import Numeric
>>> Numeric.__version__
'23.1'
>>> x=[[[1,2],[3,4]],[[5,6],[7,8]]]
>>> Numeric.diagonal(x)
array([[1, 4],
[5, 8]])
fwiw,
Alan Isaac
More information about the Numpy-discussion
mailing list