pandas.api.types.is_integer_dtype()

pandas.api.types.is_integer_dtype

pandas.api.types.is_integer_dtype(arr_or_dtype) [source]

Check whether the provided array or dtype is of an integer dtype.

Unlike in in_any_int_dtype, timedelta64 instances will return False.

Parameters:

arr_or_dtype : array-like

The array or dtype to check.

Returns:

boolean : Whether or not the array or dtype is of an integer dtype

and not an instance of timedelta64.

Examples

>>> is_integer_dtype(str)
False
>>> is_integer_dtype(int)
True
>>> is_integer_dtype(float)
False
>>> is_integer_dtype(np.uint64)
True
>>> is_integer_dtype(np.datetime64)
False
>>> is_integer_dtype(np.timedelta64)
False
>>> is_integer_dtype(np.array(['a', 'b']))
False
>>> is_integer_dtype(pd.Series([1, 2]))
True
>>> is_integer_dtype(np.array([], dtype=np.timedelta64))
False
>>> is_integer_dtype(pd.Index([1, 2.]))  # float
False

© 2008–2012, AQR Capital Management, LLC, Lambda Foundry, Inc. and PyData Development Team
Licensed under the 3-clause BSD License.
http://pandas.pydata.org/pandas-docs/version/0.20.2/generated/pandas.api.types.is_integer_dtype.html

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部