Skip to content

Latest commit

 

History

History
12 lines (9 loc) · 422 Bytes

NOTES.md

File metadata and controls

12 lines (9 loc) · 422 Bytes

NOTES

Here are some notes on tips and tricks, function and classes that I learn

diag

diag(v, k): Extract a diagonal or construct a diagonal array

  • If v is a 1D array, return a 2D array with v on the kth diagonal.
  • If v is a 2D array, return a copy of its kth diagonal.
  • Use k > 0 for diagonals above the main diagonal
  • Use k < 0 for diagonals below the main diagonal
  • Returns a ndarray