TensorLearn
Back to Course
Data Intelligence: NumPy & Pandas
Module 4 of 15

4. Tensors & Manipulation

1. Reshaping Reality

Changing the dimensions without copying data.

python
a = np.arange(9) m = a.reshape(3, 3) # Becomes a matrix

2. Masking (Boolean Indexing)

Forget if statements inside loops. Use Masks.

python
data = np.array([10, 20, 30, 40]) mask = data > 25 print(mask) # [False, False, True, True] print(data[mask]) # [30, 40]

Mark as Completed

TensorLearn - AI Engineering for Professionals