当前位置:网站首页>numpy.zeros_ like
numpy.zeros_ like
2022-07-26 20:14:00 【Wanderer001】
numpy.zeros_like(a, dtype=None, order='K', subok=True, shape=None)[source]
Return an array of zeros with the same shape and type as a given array.
Parameters:
a:array_like
The shape and data-type of a define these same attributes of the returned array.
dtype:data-type, optional
Overrides the data type of the result.
New in version 1.6.0.
order:{‘C’, ‘F’, ‘A’, or ‘K’}, optional
Overrides the memory layout of the result. ‘C’ means C-order, ‘F’ means F-order, ‘A’ means ‘F’ if a is Fortran contiguous, ‘C’ otherwise. ‘K’ means match the layout of a as closely as possible.
New in version 1.6.0.
subok:bool, optional.
If True, then the newly created array will use the sub-class type of ‘a’, otherwise it will be a base-class array. Defaults to True.
shape:int or sequence of ints, optional.
Overrides the shape of the result. If order=’K’ and the number of dimensions is unchanged, will try to keep order, otherwise, order=’C’ is implied.
New in version 1.17.0.
Returns:
out:ndarray
Array of zeros with the same shape and type as a.
See also
Return an empty array with shape and type of input.
Return an array of ones with shape and type of input.
Return a new array with shape of input filled with value.
Return a new array setting values to zero.
Examples
>>> x = np.arange(6)
>>> x = x.reshape((2, 3))
>>> x
array([[0, 1, 2],
[3, 4, 5]])
>>> np.zeros_like(x)
array([[0, 0, 0],
[0, 0, 0]])
>>> y = np.arange(3, dtype=float)
>>> y
array([0., 1., 2.])
>>> np.zeros_like(y)
array([0., 0., 0.])边栏推荐
猜你喜欢
随机推荐
Kingbases SQL language reference manual of Jincang database (16. SQL statement: create sequence to delete)
TableWidget
【ffmpeg】给视频文件添加时间戳 汇总
MySQL之InnoDB引擎(五)
LeetCode_回溯_中等_40.组合总和 II
Canvas graphics
Zhongtian steel uses tdengine in GPS and AIS scheduling
eadiness probe failed: calico/node is not ready: BIRD is not ready: Error querying BIRD: unable to c
STM32F103 active buzzer driver
I hope some suggestions on SQL optimization can help you who are tortured by SQL like me
京东荣获中国智能科学技术最高奖!盘点京东体系智能技术
记一次 .NET 某物管后台服务 卡死分析
Zabbix调用api检索方法
一家芯片公司倒在了B轮
C#将PDF文件转成图片
徽商期货开户安全吗?请问徽商期货开户应该注意什么呢?
UE5编辑器Slate快速入门【开篇】
会议OA之会议排座&送审
【机器学习】变量间的相关性分析
数组操作增,删,改,查









