A Python library for scientific computing that provides multidimensional arrays & various operations like math, logic, Fourier transform, linear algebra, & statistical operations.
1. A powerful N-dimensional array object. 2. A sophisticated broadcasting function. 3. A tool for integrating C/C++ & Fortran code
From beginner basics to advanced concepts, this cheat sheet has everything you need to master NumPY. It is filled with handy tips & commands for quick reference.
1. To load an array on CSV file disk. n.load( 'my_array.npy') 2. To write your array to a Text file on disk. n.savetxt('New_file.txt',arr,delimiter=' ')
1. Element data type in the array. array.dtype 2. Converts arrays to python lists. array.tolist() 3. Search for documentation of np.eye. n.info(n.eye)
1. Return values of the elements at index m on all rows. array[:,m] 2. To invert values of a boolean array. ~array
1. Add values of arguments arr1 and arr2 element-wise. n.add(array1,array2) 2. Return absolute value of each array element. n.abs(array)
1. Return max value of specific axis of array elements. array.max(axis=0) 2. Return variance of array elements. n.var(array)
Step Up Your Game with InterviewBit Web Stories