Numpy floor()

2024年8月29日 | 1 分钟阅读

此函数返回输入数组元素的向下取整值。数字 x 的向下取整值是 i,其中 i 是最大整数,且 i<=x。

语法

参数

  1. array: 要计算向下取整值的数组元素。

返回

返回包含向下取整值的数组。

示例

输出

Input array: [0.23, 0.09, 1.2, 1.24, 9.99]
Output array: [0. 0. 1. 1. 9.]
Input array: [145.23, 0.12, 12.34, 123]
Output array: [145.   0.  12. 123.]

下一个主题Numpy rint()