Student Activity
Student Activity Guide:
1) Introduction to NumPy Arrays
import numpy as np
# Creating a NumPy array
arr = np.array([1, 2, 3, 4, 5])
print("NumPy Array:", arr)2) Array Indexing and Slicing
# Indexing
print("First element:", arr[0]) # Access first element
# Slicing
print("First three elements:", arr[:3]) # Access first three elements3) Mathematical Operations with NumPy
4) Broadcasting and Vectorization
Last updated