import numpy as np
By literal - note that the number of opening squares equals the dimension
a = np.array([[1,2,3],[4,5,6]])
a
Create array filled with random values: np.empty of type np.int8
b = np.empty( (3,2), dtype=np.int8 )
b
Create array by np.arange() method (quite simmilar to python's range())
b = np.arange(0,21,2)
b
a[1][2]
The number of axes (dimensions) of the array: a.ndim
a = np.array([[1,2,3],[4,5,6]])
a.ndim
Tuple of integers indicating the size of the array in each dimension: ndarray.shape
a = np.array([[1,2,3],[4,5,6]])
a.shape
b = np.array([[1,2],[3,4],[5,6]])
b.shape
Total number of elements of the array: a.size
a = np.array([[1,2,3],[4,5,6]])
a.size
The size in bytes of each element of the array: a.itemsize
a = np.array([[1,2,3],[4,5,6]])
a.itemsize
a = np.array([[1,2,3],[4,5,6]])
a.ravel()
a = np.array([[1,2,3],[4,5,6]])
a.shape
a.reshape(3,2)
a.reshape(1,6)
a = np.array([[1,2,3],[4,5,6]])
b = np.array([[1,2,3],[4,5,6]])
a+b
a = np.array([[1,2,3],[4,5,6]])
b = np.array([[1,2],[3,4],[5,6]])
a.dot(b)
b.dot(a)