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.
New in version 0.24.0.
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.nanint 0bool Falsedatetime64 pd.NaTtimedelta64 pd.NaTThe default value may be overridden by specifying a
fill_value.
Attributes
fill_valueThe fill value of the array. kindThe sparse kind. nameA string identifying the data type. namesOrdered list of field names, or None if there are no fields. typeThe scalar type for the array, e.g. subtype Methods
construct_array_type()Return the array type associated with this dtype construct_from_string(string)Construct a SparseDtype from a string form. is_dtype(dtype)Check if we match ‘dtype’. update_dtype(dtype)Convert the SparseDtype to a new dtype. -
© 2008–2012, 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/0.24.2/reference/api/pandas.SparseDtype.html