In the Numeric manual, there are two different defintions of the 'diagonal' function. The second definition appears to be incorrect. p.39: diagonal(a, k=0, axis1=0, axis2 = 1) returns the entries along the k th diagonal of a (k is an offset from the main diagonal). This is designed for 2d arrays. For larger arrays, it will return the diagonal of each 2d sub-array. p.44 diagonal(a, offset=0, axis1=0, axis2=1) The diagonal function takes an array a, and returns an array of rank 1 containing all of the elements of a such that the difference between their indices along the specified axes is equal to the specified offset. With the default values, this corresponds to all of the elements of the diagonal of a along the last two axes. fwiw, Alan Isaac
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.
p.39: diagonal(a, k=0, axis1=0, axis2 = 1)
p.44 diagonal(a, offset=0, axis1=0, axis2=1)
Are you sure? On my system, it appears that the second definition is correct in both Numeric 23.3 and numarray 1.1.
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
On Tue, 2004-10-12 at 07:00, Alan G Isaac wrote:
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 ...
Ah, I thought you were referring to the fact that, in the first version
in the documentation, the second, named argument is given as "k" but in
the second version it is "offset". A look at the source reveals the
second keyword name is the correct one.
--
Stephen Walton
On Tue, 2004-10-12 at 07:00, Alan G Isaac wrote:
You did not quote the problematic portion: The diagonal function takes an array a, and returns an array of rank 1 ...
On Tue, 12 Oct 2004, Stephen Walton apparently wrote:
A look at the source reveals the second keyword name is the correct one.
OK then, we have a double problem. The first version gives the correct description but uses the wrong keyword. The second version gives the wrong description but uses the correct keyword. So, how do we file a documentation bug? Cheers, Alan Isaac
On Tue, 2004-10-12 at 12:40, Alan G Isaac wrote:
On Tue, 2004-10-12 at 07:00, Alan G Isaac wrote:
You did not quote the problematic portion: The diagonal function takes an array a, and returns an array of rank 1 ...
On Tue, 12 Oct 2004, Stephen Walton apparently wrote:
A look at the source reveals the second keyword name is the correct one.
OK then, we have a double problem. The first version gives the correct description but uses the wrong keyword. The second version gives the wrong description but uses the correct keyword.
So, how do we file a documentation bug?
Go here: http://sourceforge.net/tracker/?atid=450446&group_id=1369&func=browse then "Submit New", and set the "category" to "documentation. Regards, Todd
Cheers, Alan Isaac
------------------------------------------------------- This SF.net email is sponsored by: IT Product Guide on ITManagersJournal Use IT products in your business? Tell us what you think of them. Give us Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more http://productguide.itmanagersjournal.com/guidepromo.tmpl _______________________________________________ Numpy-discussion mailing list Numpy-discussion@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/numpy-discussion --
On 12 Oct 2004, Todd Miller apparently wrote:
Go here: http://sourceforge.net/tracker/?atid=450446&group_id=1369&func=browse then "Submit New", and set the "category" to "documentation.
Done. Thanks, Alan Isaac
On Sat, 2004-10-16 at 17:17, Alan G Isaac wrote:
On 12 Oct 2004, Todd Miller apparently wrote:
Go here: http://sourceforge.net/tracker/?atid=450446&group_id=1369&func=browse then "Submit New", and set the "category" to "documentation.
Done.
Thanks, Alan Isaac
As it turns out, I misdirected you. The above link is for numarray bugs. This link is for Numeric bugs: http://sourceforge.net/tracker/?group_id=1369&atid=101369 I moved the diagonal doc bug report to the Numeric bugs tracker. Regards, Todd
participants (4)
-
Alan G Isaac
-
Perry Greenfield
-
Stephen Walton
-
Todd Miller