API¶
Public¶
- class pydiverse.common.Dtype[source]¶
Base class for all data types.
- classmethod is_subtype(rhs)[source]¶
Return
Trueif this dtype is a subtype of rhs.For example,
Int8.is_subtype(Int())isTrue.
- to_pandas(backend: PandasBackend = PandasBackend.ARROW)[source]¶
Convert this Dtype to a pandas type.
- to_pandas_nullable(backend: PandasBackend = PandasBackend.ARROW)[source]¶
Convert this Dtype to a pandas nullable type.
Nullable can be either pandas extension types like StringDtype or ArrowDtype.
- Parameters:
backend (PandasBackend, optional) – The pandas backend to use. Defaults to
PandasBackend.ARROW. IfPandasBackend.NUMPYis selected, this method will attempt to return a NumPy-backed nullable pandas dtype. Note that Time, NullType, and List will raise a TypeError for the NUMPY backend as pandas doesn’t have corresponding native nullable dtypes for these.
- class pydiverse.common.List(inner: pydiverse.common.dtypes.Dtype)[source]¶