Python Forum

Full Version: numpy diagonal
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
hi, need help with numpy.diagonal.
Using
 grid.diagonal(0)
for a 9 by 9 matrix
I can see the diagonal [0,0} to [8,8}.
How do I see the diagonal [0,8] - [8,0]?
Also how do I display cell row and column ([0, 0]) rather than values?
Thanks for any help
Use numpy.flipud first and then .diagonal; i.e. np.flipud(x).diagonal()