Nptel Presentation
Nptel Presentation
SESSION:-2023-24
DATA SCIENCE USING PYTHON
(160517)
NPTEL PRESENTATION
• All elements of array are of same data type. List can have elements of different data types.
• Elements of an array are stored in contiguous . List elements are not stored contiguously
memory locations in memory.
• Arrays are static and can not be resized once . List can be resized and modify easily.
they are created
• Arrays support element wise operation. List do not support element wise operation.
• Arrays take less space in memory. List take more space in memory
ARRAY CREATION
● np.zeros ((rows,cols)) : Initialising numpy array with 0.
2-Dimensional
SLICING IN ARRAY
ARR[START-INDEX : END-INDEX :
STEP]
OPERATIONS ON ARRAY
SORTING AN ARRAY
● np.sort( array-name ) : make a copy of original array and returns
the sorted copy without changing original array.
● np.argsort( array-name ) : sort the copy of original array and
returns the Index of sorted list without changing original array.
● array-name.sort( ) : sort the original array and returns nothing.
● np.max( array-name )
● np.min( array-name )
● np.sum( array-name )
● np.mean( array-name )
● np.median( array-name )
● np.prod( array-name )
● np.var( array-name )
● np.std( array-name )