numpy.iinfo()函数显示整数类型的机器限制。
用法: numpy.iinfo(dtype)
参数:
dtype:[整数类型,dtype或实例]要获取其有关信息的整数数据类型的种类。
返回:整数类型的机器限制。
代码1:
# Python program explaining
# numpy.iinfo() function
# importing numpy as geek
import numpy as geek
gfg = geek.iinfo(geek.int16)
print (gfg)
输出:
Machine parameters for int16
---------------------------------------------------------------
min = -32768
max = 32767
---------------------------------------------------------------
代码2:
# Python program explaining
# numpy.iinfo() function
# importing numpy as geek
import numpy as geek
gfg = geek.iinfo(geek.int32)
print (gfg)
输出:
Machine parameters for int32
---------------------------------------------------------------
min = -2147483648
max = 2147483647
---------------------------------------------------------------