3 min read
What Is NumPy?
NumPy stands for Numerical Python.
It is a Python library designed for working efficiently with numbers, arrays, matrices, multidimensional numerical data, and mathematical calculations.
The most important object in NumPy is called an ndarray, which means N-dimensional array. An array stores multiple values together in an organized numerical structure.
- Numbers
- Arrays
- Matrices
- Multidimensional numerical data
- Mathematical calculations
Example array:
[10, 20, 30, 40]
A table of values can also be represented:
[
[80, 90, 85],
[75, 88, 92]
]
Your First NumPy Example :
import numpy as np
a = np.array([
[10, 20, 30],
[40, 50, 60]
])
b = np.array([1, 2, 3])
print(a + b)
Output :
[10 20 30 40]
What Does This Code Mean?
- import numpy as np imports NumPy and gives it the standard short name np.
- np.array(...) creates a NumPy array.
- numbers stores the created array in a variable.
Where Is This Useful?
- Student marks
- Product prices
- Daily temperatures
- Sales numbers
- Sensor readings
- Image pixels
- Scientific measurements
Common Beginner Mistake
- array([10, 20, 30])
Correct approach:
- import numpy as np
- arr = np.array([10, 20, 30])
Try It Yourself
Create a NumPy array containing 5, 10, 15, 20, 25 and print it.
Key Takeaway: NumPy is a Python library built around powerful multidimensional arrays for numerical computing.
Goal
Goal



Understanding the Code :
💬 Comments & Discussion
No comments yet
Be the first to share your thoughts!