On Tue, Jul 23, 2013 at 3:39 PM, Alan G Isaac <[email protected]> wrote:
> On 7/23/2013 9:09 AM, Pauli Virtanen wrote:
>> .flat which I think
>> is rarely used
>
> Until ``diagonal`` completes its transition,
> use of ``flat`` seems the best way to reset
> the diagonal on an array.  Am I wrong?
> I use it that way all the time.

I usually write

x[np.diag_indices_from(x)] = [1,2,3]

Stéfan
_______________________________________________
NumPy-Discussion mailing list
[email protected]
http://mail.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to