[SciPy-user] assign to diagonal values?

Fernando Perez fperez.net@gmail....
Tue Jul 7 11:53:29 CDT 2009

Hey Stefan,

2009/7/4 Stéfan van der Walt <stefan@sun.ac.za>:
> 2009/7/1 Fernando Perez <fperez.net@gmail.com>:
>> If someone feels like reviewing this ticket:
>> http://projects.scipy.org/numpy/attachment/ticket/1132/numpy-index-funcs.diff
>> it has the above and a few more utilities, with docs and tests.
> Thanks! Reviewed and applied in r7101 through r7103.

thanks for working on that ticket!

BTW, looking at


line 740:

step = cumprod((1,)+a.shape[:-1]).sum()

might be better written as suggested by Anand:

step = 1+(cumprod(a.shape[:-1])).sum()

which replaces a tuple concatenation by a simple numerical addition.

Order-epsilon nit though.  Thanks for the extra tests too!



More information about the SciPy-user mailing list