pandas.api.types.is_sparse

pandas 3.1.1 · Arrays, scalars, and data types · function

Check whether the input has sparse dtype. Use isinstance(dtype, pd.SparseDtype) for new code.

Call syntax

pd.api.types.is_sparse(arr)

Run the example

Edit the example and select Run Python to see the result.

Parameters

ParameterRequirementAccepted values and behavior
arr Required
Positional or keyword
array-like

Returns

bool