To use NumPy with Python, import it at the top of your file using the following line:

import numpy as np

Writing as np allows us to use np as a shorthand for NumPy, which saves us time when calling a NumPy function (less typing = fewer errors!)



Import the NumPy package in script.py

Sign up to start coding

Mini Info Outline Icon
By signing up for Codecademy, you agree to Codecademy's Terms of Service & Privacy Policy.

Or sign up using:

Already have an account?