9951 explained code solutions for 126 technologies


python-numpyHow to generate empty Numpy matrix


import numpy as np
matrix = np.empty([5, 4])ctrl + c
import numpy as np

load Numpy module for Python

.empty

generate empty Numpy array of the specified shape

[5, 4]

we will generate 5x4 empty matrix

matrix

will contain generated Numpy matrix