*NumPy: Changing Shapes*

NumPy is a library which provides fast alternative to math operations in Python. There are several data types in NumPy like Scalar, Vector, Matrix and Tensors which represents the dimensions of data. Scalar represents empty tuple i.e., zero dimension, Vector is one-dimensional, Matrix is…