p norm of a vector python

Solutions on MaxInterview for p norm of a vector python by the best coders in the world

showing results for - "p norm of a vector python"
Vincent
22 Apr 2018
1np.linalg.norm(x, 2)
2
Joaquín
09 Feb 2019
1np.sqrt(np.sum(np.power(x, 2)))
2