Exploring NumPy Arrays
Today I started with one of the most powerful Python libraries for data and scientific computing β NumPy π’
πΉ Creating Arrays
import numpy as np
arr = np.array([1, 2, 3, 4, 5])
print(arr) # [1 2 3 4 5]
πΉ Indexing & Slicing
print(arr[0]) # 1
print(arr[1:4]) # [2 3 4]
πΉ Array Manipulation
arr2 = np.array([10, 20, 30, 40, 50])
print(arr + arr2) # [11 22 33 44 55]
print(arr * 2) # [ 2 4 6 8 10]
β‘ Interesting Facts
β’ NumPy arrays are faster and more memory efficient than Python lists
β’ They support vectorized operations (no need for loops!)
β’ Widely used in machine learning, AI, and data analytics
β¨ Reflection
Working with NumPy arrays feels like unlocking Pythonβs superpower. I can already see why itβs a must-have for data analytics.
Next β Iβll explore more advanced NumPy operations π
Top comments (0)