1>> import numpy as np
2>> fives = np.repeat(5, 10)
3#This creates an array of the number 5 repeated 10 times.
1>>> np.full((3, 5), 7)
2array([[ 7., 7., 7., 7., 7.],
3 [ 7., 7., 7., 7., 7.],
4 [ 7., 7., 7., 7., 7.]])
5
6>>> np.full((3, 5), 7, dtype=int)
7array([[7, 7, 7, 7, 7],
8 [7, 7, 7, 7, 7],
9 [7, 7, 7, 7, 7]])
1>>> np.full((3, 5), 7)
2array([[ 7., 7., 7., 7., 7.],
3 [ 7., 7., 7., 7., 7.],
4 [ 7., 7., 7., 7., 7.]])
5
6>>> np.full((3, 5), 7, dtype=int)
7array([[7, 7, 7, 7, 7],
8 [7, 7, 7, 7, 7],
9 [7, 7, 7, 7, 7]])
10
1>> import numpy as np
2
3>> np.full(
4 shape=10,
5 fill_value=3,
6 dtype=np.int)
7
8array([3, 3, 3, 3, 3, 3, 3, 3, 3, 3])