🧮 Introduction to NumPy

Last Updated: 02 Nov 2025


  • NumPy (Numerical Python) is a powerful Python library used for numerical and scientific computing. It provides multi-dimensional arrays and fast mathematical operations on them.
  • Python lists are like normal boxes, then NumPy arrays are like super-fast containers that handle big data easily (used in Data Science, ML, AI, etc.).
  • It is fast because it uses C and C++ under the hood.

🗣 Hinglish Tip: “Python list har element ko alag handle karta hai, par NumPy ek hi type ke saare data ko ek saath handle karta hai — isliye fast hota hai!”


Install NumPy

Before using, install it in your system.

pip install numpy

Import numpy in your script

import numpy as np

NumPy Data Types

NumPy supports numerical data types like integers, floats, complex numbers, and booleans.

SymbolMeaningExampleDescription
bBooleanbool_True or False
iSigned integeri1, i2, i4, i8e.g. i4 = 4 bytes = int32
uUnsigned integeru1, u2, u4, u8Only positive values
fFloating pointf2, f4, f8e.g. f8 = float64
cComplex floating pointc8, c16Complex numbers
mTime deltam8[ns]Difference between dates
MDatetimeM8[D], M8[ns]Date/time data
U,str_Unicode stringU21String (21 characters wide)
SByte stringS10String (10 bytes)
OObjectobjectPython objects or mixed types