create an array of n same value python

Solutions on MaxInterview for create an array of n same value python by the best coders in the world

showing results for - "create an array of n same value python"
Imran
07 Feb 2019
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])