Lavanya-M22 Numpy
Lavanya-M22 Numpy
Lavanya-M22 Numpy
NumPy is an open-source numerical Python library used for working np.array(object) Creates an array
with arrays. It aims to provide an array object that is upto 50x faster np.array([1,2,3]) 1D array
than traditional python list takes significantly less amount of memory
np.array([(1,2,3),(4,5,6)]) 2D array
as compared to python lists.
np.zeros(shape) Return a new array of given shape
and type, filled with zeros
How to Install Numpy
np.ones(shape) Return a new array of given shape
pip install numpy
and type, filled with ones
or
np.eye(no. of rows) Return a 2-D array with ones on the
conda install numpy
diagonal and zeros elsewhere
Useful links