Numpy

Size - Numpy data structures take up less space

Performance - they have a need for speed and are faster than lists

Functionality - SciPy and NumPy have optimized functions such as linear algebra operations built in.

Array

In [0]:
# Create np.array

import numpy as np

my_array1 = np.array([1, 2, 3, 4, 5])
my_array2 = np.arange(1, 10)
my_array3 =[1, 1, 1]
my_array4 = np.ones((3, 4))
my_list5 = np.zeros(5)

type(my_array1)
Out[0]:
numpy.ndarray
In [0]:
# Data type

my_list = [1, 2, 3, 4, 5]

# Show datat type
type(my_list)

# Change data type
np.array(my_list, dtype='float64')
Out[0]:
array([1., 2., 3., 4., 5.])