Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

np diag

>>> np.diag(np.diag(x))
array([[0, 0, 0],
       [0, 4, 0],
       [0, 0, 8]])
Comment

np diag

x = [0, 4, 8]
print(np.diag(x))

# Output:
[[0, 0, 0],
 [0, 4, 0],
 [0, 0, 8]]
Comment

PREVIOUS NEXT
Code Example
Python :: python list pop equivalent 
Python :: deque in python 
Python :: linear search in c++ 
Python :: scikit learn 
Python :: prompt python 
Python :: linked list python 
Python :: python try except print error 
Python :: random.random 
Python :: count function in python 
Python :: python double underscore methods 
Python :: numpy array into tuple 
Python :: python if in one line 
Python :: python modules list 
Python :: setup vs code for python 
Python :: row count pandas 
Python :: how to change title font size in plotly 
Python :: isenable selenium python 
Python :: pd column to one hot vector 
Python :: python change font in 1 line 
Python :: Python - Comment convertir le texte en discours 
Python :: pdf reading shows gibberish python 
Python :: Fifth step Creating Advance app in python django 
Python :: best api for python 
Python :: adding if statements in pyhton with tuple 
Python :: python with statement local variables 
Python :: pythonmodules.txt 
Python :: sklearn mahalanobis distance 
Python :: def LinearSearch(array, n, k): 
Python :: dickyfuller test in python 
Python :: python integrated with activeX 
ADD CONTENT
Topic
Content
Source link
Name
6+3 =