Locked lesson.
About this lesson
In this video, we discuss how Numpy arrays work, including how they are much, much faster to work with than regular Python arrays.
Exercise files
Download this lesson’s related exercise files.
Numpy Arrays.docx57.1 KB Numpy Arrays - Solution.docx
55.4 KB
Quick reference
Numpy Arrays
Numpy Arrays are very much like Python Lists.
When to use
We'll use them directly and indirectly for the rest of the course.
Instructions
This is a basic Numpy Array:
np.array = [1,2,3]
Arrays can be Vectors (one dimension) or a Matrix (two dimensional).
An example of a Matrix Numpy Array is:
np.array([[1,2,3],[4,5,6],[7,8,9]])
Hints & tips
- Vector Numpy Array: np.array = [1,2,3]
- Matrix Numpy Array: np.array([[1,2,3],[4,5,6],[7,8,9]])
Lesson notes are only available for subscribers.