NumPy (Numerical Python) is a fundamental Python library for scientific computing and numerical operations. It provides support for large, multi-dimensional arrays and matrices, along with a vast collection of high-level mathematical functions to operate on these arrays efficiently.
-
ndarray (N-dimensional array):
- NumPy's core feature is the ndarray, a fast and memory-efficient array object for handling large datasets.
- Supports vectorized operations (eliminating the need for loops).
-
Mathematical Functions:
- Provides linear algebra, Fourier transforms, random number generation, and more.
- Optimized for performance (written in C and Fortran).
-
Broadcasting:
- Allows operations on arrays of different shapes.
-
Interoperability:
- Works well with other libraries like Pandas, SciPy, Matplotlib, TensorFlow, and PyTorch.
-
Memory Efficiency:
- Uses contiguous memory blocks, making it faster than Python lists.
00_numpy_intro.ipynb:- NumPy introduction
01_creating_arrays.ipynb:- NumPy array definition
- Understanding Dimensions in Arrays
- Create Array Using
arange - Create Array Using
linspace - Creating Array Using
zeros - Creating Array Using
ones - Get Array Size
- Create Array Using
random
03_slicing_and_indexing.ipynb:- Basic Indexing
- Slicing Array
- Advanced Indexing
- Key Differences Between Indexing & Slicing
- Notes on Slicing and Indexing
04_shaping_arrays.ipynb:- Array Shape concept
- Check array shape using
shape - Reshape an array using
reshape - Flatten an array using
flatten - Resize an array using
resize - Transpose an array using
transposeandndarray.T attribute - Swap axes an array
swapaxes
05_stacking_and_splitting.ipynb:- Stacking array using:
stackvstackdstack
- Splitting array using:
splitvsplithsplitdsplit
- Real-World Applications of Stacking and Splitting Arrays in NumPy
- Stacking array using:
copying_array.ipynb:- Copying array using:
copynp.copy
- Copying array using:
07_basic_math.ipynb:- Arithmetic Operations using :
addsubtractmultiplydividepowersqrtsinsbs
- Aggregation Operations using:
summinmaxmeanstdargmax
- Matrix Operations using:
dot
- Cumulative Sum using:
cumsum
- Logarithmic Operations using:
loglog2log10
- Greatest Common Divisor (GCD) using:
gcd.reduce
- Least Common Multiple (LCM) using:
lcm.reduce
- Rounding Functions using:
ceilfloor
- Arithmetic Operations using :
08_numpy_and_panda.ipynb:- todo
09_statistic_functions.ipynb:- Calculate mean using
mean - Calculate median using
median - Calculate variance using
var - Calculate standard deviation using
std - Calculate minimun using
min - Calculate maximum using
max - Calculate product using
prod - Calculate quantiles using
quantile - Calculate correlation using
corrcoef - Calculate covariance using
cov - Create histogram using
histogramandhistogram2d - Calculate convolution using
convolve
- Calculate mean using
10_trigonometric_functions.ipynb:- Basic Trigonometric Functions:
sincostan
- Inverse Trigonometric Functions:
arcsinarccosarctanarctan2
- Hyperbolic Trigonometric Functions:
sinhcoshtanh
- Angle Conversion Functions:
deg2radrad2deg
- Basic Trigonometric Functions:
11_matrix_functions.ipynb:- Matrix Creation:
numpy.array()numpy.matrix()numpy.eye()numpy.zeros()numpy.ones()
- Matrix Operations:
numpy.dot()numpy.transpose()or.Tnumpy.linalg.inv()numpy.linalg.det()numpy.trace()numpy.linalg.multi_dot
- Eigenvalues & Eigenvectors:
numpy.linalg.eig()numpy.linalg.eigvals()
- Matrix Decomposition:
numpy.linalg.svd()numpy.linalg.qr()numpy.linalg.cholesky()
- Solving Linear Equations:
numpy.linalg.solve()numpy.linalg.lstsq()
- Matrix Norms:
numpy.linalg.norm()
- Matrix Exponentiation
numpy.linalg.matrix_power()
- Matrix Creation:
12_saving_and_loading.ipynb:- Saving NumPy Object using
save - Loading Numpy Object using
load - Saving Numpy Object as CSV using
savetxt - Loading CSV file
loadtxt
- Saving NumPy Object using
13_numpy_financial.ipynb:- Install numpy_financial library
pip install numpy-financial - Calculates the future value of an investment using
fvfunction - Calculates the present value of an investment using
pvfunction - Calculates the payment for a loan using
pmtfunction - Calculates the net present value of a cash flow series using
npvfunction - Calculates the internal rate of return for a series of cash flows using
irrfunction - Calculates the number of periods for an investment using
nperfunction - Calculates the interest rate per period using
ratefunction
- Install numpy_financial library
14_comparison_functions.ipynb:- Comparison Functions:
numpy.equalor==numpy.not_equalor!=numpy.greateror>numpy.greater_equalor>=numpy.lessor<numpy.less_equalor<=numpy.array_equalnumpy.logical_andnumpy.logical_ornumpy.logical_notnumpy.isclose
- Comparison Functions: