Tsallaka zuwa abun ciki
Justice Tech School

NumPy Introduction

NumPy is the base library for numerical computing in Python. Its ndarray holds numbers in one block of memory, so math on whole arrays is much faster than Python loops.

Example
import numpy as np
a = np.array([1, 2, 3])
print(a, type(a).__name__)
print(a * 2)
print(np.__version__ >= '1')

Result

[1 2 3] ndarray
[2 4 6]
True

Exercise

Import NumPy with its usual name.

import numpy as 

Quiz Test

What is the main NumPy object?

These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.