pandas.SparseDtype.is_dtype

classmethod SparseDtype.is_dtype(dtype) [source]

Check if we match ‘dtype’.

Parameters:
dtype : object

The object to check.

Returns:
is_dtype : bool

Notes

The default implementation is True if

  1. cls.construct_from_string(dtype) is an instance of cls.
  2. dtype is an object and is an instance of cls
  3. dtype has a dtype attribute, and any of the above conditions is true for dtype.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.is_dtype.html