NumPy 的 iinfo(~)
方法返回有关特定 NumPy 整数数据类型的信息。信息包括该数据类型占用的位数以及支持值的最大和最小限制。
参数
1. type
| dtype
要检索相关信息的整数数据类型。
返回值
具有三个属性的 <class 'numpy.iinfo'>
对象:
-
bits
:提供的整数数据类型占用的位数 -
min
:所提供整数数据类型的最小支持值 -
max
:所提供的整数数据类型的最大支持值
例子
基本用法
要检索有关 int32
数据类型的信息:
np.iinfo(np.int32)
iinfo(min=-2147483648, max=2147483647, dtype=int32)
位
要检索 int32
数据类型占用的位数:
np.iinfo(np.int32).bits
32
分钟
要检索 int32
的最小允许值:
np.iinfo(np.int32).min
-2147483648
最大限度
要检索 int32
的最大允许值:
np.iinfo(np.int32).max
2147483647
相关用法
- Python NumPy itemset方法用法及代码示例
- Python import__用法及代码示例
- Python isinstance方法用法及代码示例
- Python BeautifulSoup insert方法用法及代码示例
- Python itertools.takewhile用法及代码示例
- Python id()用法及代码示例
- Python ipaddress.collapse_addresses用法及代码示例
- Python ipaddress.IPv4Address.reverse_pointer用法及代码示例
- Python io.text_encoding用法及代码示例
- Python string isidentifier()用法及代码示例
- Python numpy irr用法及代码示例
- Python ipaddress.IPv4Address.__format__用法及代码示例
- Python calendar isleap()用法及代码示例
- Python math isclose()用法及代码示例
- Python NumPy isalnum方法用法及代码示例
- Python NumPy isnat方法用法及代码示例
- Python string isupper()用法及代码示例
- Python itertools.cycle用法及代码示例
- Python itertools.dropwhile用法及代码示例
- Python scipy integrate.trapz用法及代码示例
- Python itertools.repeat用法及代码示例
- Python ipaddress.IPv4Network.supernet用法及代码示例
- Python string isalnum()用法及代码示例
- Python Pandas isnull方法用法及代码示例
- Python inspect.Parameter.replace用法及代码示例
注:本文由纯净天空筛选整理自Arthur Yanagisawa大神的英文原创作品 NumPy | iinfo method。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。