https://docs.scipy.org/doc/numpy-1.16.1/reference/generated/numpy.ones.html?highlight=ones
numpy.ones
(shape, dtype=None, order=’C’)
Return a new array of given shape and type, filled with ones.
例子
1 | 5) np.ones( |
1 | 5,), dtype=int) np.ones(( |
1 | 2, 1)) np.ones(( |
1 | 2,2) s = ( |