pandas.SparseDtype

class pandas.SparseDtype(dtype=<class 'numpy.float64'>, fill_value=None)[source]

Dtype for data stored in SparseArray.

This dtype implements the pandas ExtensionDtype interface.

Parameters
dtype:str, ExtensionDtype, numpy.dtype, type, default numpy.float64

The dtype of the underlying array storing the non-fill value values.

fill_value:scalar, optional

The scalar value not stored in the SparseArray. By default, this depends on dtype.

dtype

na_value

float

np.nan

int

0

bool

False

datetime64

pd.NaT

timedelta64

pd.NaT

The default value may be overridden by specifying a fill_value.

Attributes

None

Methods

None

© 2008–2021, AQR Capital Management, LLC, Lambda Foundry, Inc. and PyData Development Team
Licensed under the 3-clause BSD License.
https://pandas.pydata.org/pandas-docs/version/1.3.4/reference/api/pandas.SparseDtype.html