Created
April 4, 2020 00:34
-
-
Save codingsnap/d91bbcd246ca25d5dff7021c1b05ba7b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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