Module 10

NumPy introduction

Fast numerical computing.

Numerical Python

NumPy is a library for numerical computing. It provides arrays that are faster than lists for mathematical operations.

Python
import numpy as np
arr = np.array([1, 2, 3, 4])
print(arr * 2)
[2 4 6 8]
Your task

Use NumPy

  • Create a NumPy array and multiply by 2.