从ceil的NumPy 文档中 ,该numpy.ceil函数有两个参数,第二个是out.文档没有说明这个out参数是做什么的,但我假设你可以设置这个函数返回的输出类型,但是我无法让它工作:
In [107]: np.ceil(5.5, 'int')
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-107-c05bcf9f1522> in <module>()
----> 1 np.ceil(5.5, 'int')
TypeError: return arrays must be of ArrayType
In [108]: np.ceil(5.5, 'int64')
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-108-0937d09b0433> in <module>()
----> 1 np.ceil(5.5, 'int64')
TypeError: return arrays must be of ArrayType
Run Code Online (Sandbox Code Playgroud)
是否可以使用此参数使np.ceil返回为整数?
谢谢.