📜  在 python 代码示例中创建零数组

📅  最后修改于: 2022-03-11 14:46:45.331000             🧑  作者: Mango

代码示例1
# WE CAN USE NUMPY FOR THIS 
import numpy as np
np.zeros(5) # Creates an array [0., 0., 0., 0., 0.]

# For integer array of zeros

np.zeros((5,), dtype=int) # Creates array [0, 0, 0, 0, 0]