9951 explained code solutions for 126 technologies


python-numpyHow to create Numpy matrix


import numpy as np
m = np.matrix([[1, 2], [3, 4]])ctrl + c
import numpy as np

load Numpy module for Python

[[1, 2], [3, 4]]

sample matrix data

np.matrix

creates matrix from given data