pandas.api.extensions.ExtensionDtype¶
-
class
pandas.api.extensions.
ExtensionDtype
[source]¶ A custom data type, to be paired with an ExtensionArray.
New in version 0.23.0.
Notes
The interface includes the following abstract methods that must be implemented by subclasses:
- type
- name
- construct_from_string
The na_value class attribute can be used to set the default NA value for this type.
numpy.nan
is used by default.This class does not inherit from ‘abc.ABCMeta’ for performance reasons. Methods and properties required by the interface raise
pandas.errors.AbstractMethodError
and noregister
method is provided for registering virtual subclasses.Attributes
kind
A character code (one of ‘biufcmMOSUV’), default ‘O’ name
A string identifying the data type. names
Ordered list of field names, or None if there are no fields. type
The scalar type for the array, e.g. Methods
construct_from_string
(string)Attempt to construct this type from a string. is_dtype
(dtype)Check if we match ‘dtype’.