pandas.api.types.is_float_dtype #

pandas.api.types。is_float_dtype ( arr_or_dtype ) [来源] #

检查提供的数组或数据类型是否为浮点数据类型。

参数
arr_or_dtype类数组或 dtype

要检查的数组或数据类型。

返回
布尔值

数组或数据类型是否为浮点数据类型。

例子

>>> from pandas.api.types import is_float_dtype
>>> is_float_dtype(str)
False
>>> is_float_dtype(int)
False
>>> is_float_dtype(float)
True
>>> is_float_dtype(np.array(['a', 'b']))
False
>>> is_float_dtype(pd.Series([1, 2]))
False
>>> is_float_dtype(pd.Index([1, 2.]))
True