Answers for "get scalar of vector numpy array"

0

get scalar of vector numpy array

import numpy as np
x = np.array([1,2,3,4,5])
np.linalg.norm(x)
#kinda weird for numpy to name it 'norm'
Posted by: Guest on January-18-2022
0

get scalar of vector numpy array

mag = np.sqrt(x.dot(x))
Posted by: Guest on January-18-2022

Python Answers by Framework

Browse Popular Code Answers by Language