np.full in python code example
Example 1: numpy full
import numpy as np
# Creates a 5x5 2d matrix with values True
output = np.full((5,5), True)
# Proof
print(output)
#[[ True True True True True]
# [ True True True True True]
# [ True True True True True]
# [ True True True True True]
# [ True True True True True]]
Example 2: np.full
>>> np.full((2, 2), np.inf)
array([[inf, inf],
[inf, inf]])
>>> np.full((2, 2), 10)
array([[10, 10],
[10, 10]])