← NumPy & Pandas learning path
NumPy & Pandas · Module 2 of 10

NumPy operations

Index, slice and calculate with arrays.

📖 Key ideas

  1. Vectorised maths: arr * 2, arr + arr2.
  2. Indexing: arr[0], arr[-1]; slicing arr[1:4].
  3. 2D indexing: matrix[row, col].
  4. Aggregates: sum, mean, max, min, std, with axis=0 or 1.
  5. Broadcasting lets arrays of different shapes combine.
💡 Real-life example: Broadcasting is adding the same tip to every bill in a stack without writing a loop.
VectorisationOperating on whole arrays at once
BroadcastingCombining arrays of compatible shapes
axisDimension to aggregate along
Boolean maskArray of True/False to filter