参考:https://numpy.org/doc/stable/reference/generated/numpy.zeros.html
语法格式
numpy.zeros(shape, dtype=float, order='C', *, like=None)
常用参数解释:
- shape: 接受整数或元组,表示array的形状。如
(2, 3)
or2
- dtype: array的数据类型,默认为
numpy.float64
- order: 可选的,接受
{'C', 'F'}
,默认为'C'
,表示以行为主(C-style)或列为主(Fortran-style)填充数据
代码示例
>>> import numpy as np
>>> np.zeros((3,2))
array([[0., 0.],
[0., 0.],
[0., 0.]])
标签:style,填充,dtype,zeros,array,numpy From: https://www.cnblogs.com/chaimy/p/17245903.html