rint专题

Numpy数组的取整及类型转换:ceil, floor, trunc, rint, around等

Numpy数组的取整函数 函数名功能numpy.ceil(x,)向正无穷取整, ⌈ x ⌉ \lceil \bm x \rceil ⌈x⌉numpy.floor(x,)向负无穷取整, ⌊ x ⌋ \lfloor \bm x \rfloor ⌊x⌋numpy.trunc/fix(x,)截取整数部分numpy.rint(x,)四舍五入到最近整数numpy.around(x,)四舍五入到给定的小数位