DEV Community

Aditi Sharma
Aditi Sharma

Posted on

πŸš€ Day 10 of My Python Learning Journey

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 πŸš€

Python #NumPy #100DaysOfCode #DataAnalytics #DevCommunity

Top comments (0)