0PricingLogin
Data Science Academy · Lesson

Vectorized Math Without Loops

Element-wise operations across whole arrays.

Math on Whole Arrays

With NumPy you rarely write loops for math. You apply an operation to a whole array at once, and every element updates together. ⚡

The Old Loop Way

In plain Python, doubling numbers means looping one by one. It works, but it's verbose and slow for big datasets.

out = []
for x in nums:
    out.append(x * 2)

All lessons in this course

  1. From Python List to ndarray
  2. Shape, Size, and dtype
  3. Vectorized Math Without Loops
  4. Indexing and Slicing Arrays
← Back to Data Science Academy