pandas.api.types.is_bool#

pandas.api.types.is_bool(obj)#

Return True if given object is boolean.

This function checks whether obj is an instance of Python’s built-in bool type. It does not return True for numeric values like 0 or 1 that can evaluate as booleans.

Parameters:
objobject

Object to check.

Returns:
bool

See also

api.types.is_scalar

Check if the input is a scalar.

api.types.is_integer

Check if the input is an integer.

api.types.is_float

Check if the input is a float.

Examples

>>> pd.api.types.is_bool(True)
True
>>> pd.api.types.is_bool(1)
False