How to normalize a NumPy array to a unit vector?

Numpy or numerical python is a free software tool that makes scientific computations easy in python. It is very powerful python library that provides a huge range of functions for operating on arrays. It contains logical, linear algebraic and also…