今天写代码的意外收获,其实是失误,一处写成了math.ceil,一处写成了numpy.ceil,意外发现它们的返回值类型,一个是int(math.ceil),一个是float(numpy.ceil)
具体可以看下面的例子说明:
import math
import numpy as np
print(type(math.ceil(11.4)), type(np.ceil(11.4)))
# 打印结果为<class 'int'> <class 'numpy.float64'>
小伙伴们使用的时候要注意啦~