Bottom Page

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 numpy diagonal
#1
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
Quote
#2
Use numpy.flipud first and then .diagonal; i.e. np.flipud(x).diagonal()
Quote

Top Page

Possibly Related Threads...
Thread Author Replies Views Last Post
  numpy.copy / numpy.delete paul18fr 3 720 Jul-26-2019, 01:51 PM
Last Post: paul18fr
  "erlarge" a numpy-matrix to numpy-array PhysChem 2 771 Apr-09-2019, 04:54 PM
Last Post: PhysChem
  Diagonal grid products PythonLamer 1 937 Dec-05-2017, 11:32 AM
Last Post: Larz60+

Forum Jump:


Users browsing this thread: 1 Guest(s)