pandas.api.types.is_float_dtype#

pandas.api.types.is_float_dtype(arr_or_dtype)[source]#

Check whether the provided array or dtype is of a float dtype.

The function checks for floating-point data types, which represent real numbers that may have fractional components.

Parameters:
arr_or_dtypearray-like or dtype

The array or dtype to check.

Returns:
boolean

Whether or not the array or dtype is of a float dtype.

See also

api.types.is_numeric_dtype

Check whether the provided array or dtype is of a numeric dtype.

api.types.is_integer_dtype

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

api.types.is_object_dtype

Check whether an array-like or dtype is of the object dtype.

Examples

>>> 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.0]))
True