📅  最后修改于: 2022-03-11 14:46:57.757000             🧑  作者: Mango
# Basic syntax:
np.ones((number_rows, number_cols), dtype=int)
# Example usage:
import numpy as np
np.ones((5, 3), dtype=int)
array([[1, 1, 1],
[1, 1, 1],
[1, 1, 1],
[1, 1, 1],
[1, 1, 1]])
# Note, use np.zeros to create an array of zeros