Numpy Core
Lesson 2 of 18 in Coddy's Numpy Fundamentals course.
What is an Array?
An array is an efficient, compact, and fast grid that can easily be accessed and manipulated using various built-in functions. Numpy array elements must be of the same type referred to as the array dtype. It is similar to Python lists, but arrays have more functionality; they use less memory and are easier to use.
Usually, Numpy arrays are called ndarray which stands for "n-dimentional array". ndarray can hold
- vectors (1- dimension)
- matrices (2 - dimensions)
- tensors (3 - dimensions or higher)
To create a Numpy array use np.array:
np.array([1, 2, 3])This lesson includes a short quiz. Start the lesson to answer it and track your progress.
This lesson includes a short quiz. Start the lesson to answer it and track your progress.
Challenge
EasyCreate a function named list_to_array that receives a list and returns a numpy array.
Try it yourself
import numpy as np
def list_to_array(lst):
passAll lessons in Numpy Fundamentals
2N-Dimensional Array Creation
Higher DimensionUnderstanding ShapesPopulate with Fixed ValuesNumpy TypesRangeReshape