text_plain_output_1.png
import numpy as np

import numpy as np # linear algebra

np.array([1, 2, 3, 4])

a = np.array([1, 2, 3, 4])
b = np.array([0, 0.5, 1, 1.5, 2])

a.dtype

np.array([1, 2, 3, 4], dtype=float)

np.array([1, 2, 3, 4], dtype=int)

c = np.array(['a', 'b', 'c'])

d = np.array([{'a': 1}])

A = np.array([[1, 2, 3], [4, 5, 6]])

A.shape

A.ndim

B = np.array([[[12, 11, 10], [9, 8, 7]], [[6, 5, 4], [3, 2, 1]]])

C = np.array([[[12, 11, 10], [9, 8, 7]], [[6, 5, 4]]])

A = np.array([[1, 2, 3], [4, 5, 6], [7, 8, 9]])

A[1] = np.array([10, 10, 10])

a = np.array([1, 2, 3, 4])

a.sum()

a.mean()

a.std()