Skip to content

Instantly share code, notes, and snippets.

@codingsnap
Created April 4, 2020 00:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save codingsnap/d91bbcd246ca25d5dff7021c1b05ba7b to your computer and use it in GitHub Desktop.
Save codingsnap/d91bbcd246ca25d5dff7021c1b05ba7b to your computer and use it in GitHub Desktop.
a = np.diag([1,2,3,4])
print(a)
Output:
[[1 0 0 0]
[0 2 0 0]
[0 0 3 0]
[0 0 0 4]]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment