WeCodeAcademy

What is NumPy?

NumPy gives Python fast arrays: grids of numbers that all have the same type. Instead of looping over a list, you do maths on the whole array at once. Almost every data tool in Python (Pandas, scikit-learn, plotting) is built on it.

The usual first line is import numpy as np.

Examplepython
Open in editor »
Quick check

What does `np.array([1, 2, 3]) * 2` give?

Your turn: write the code

Make an array from 1 to 5 and print it doubled.

Finish the quick check (and any code exercise) to complete this lesson, or mark it done yourself.

Tip: use the left and right arrow keys to move between lessons.