How to get the magnitude of a vector in NumPy?