pandas_domains#

Domains for Pandas datatypes.

Data#

PandasColumnsDescriptor#

Mapping from column name to column domain.

Classes#

PandasSeriesDomain

Domain of Pandas Series.

PandasDataFrameDomain

Domain of Pandas DataFrames.

class PandasSeriesDomain#

Bases: tmlt.core.domains.base.Domain

Domain of Pandas Series.

Note

The index is always ignored when this domain type is used.

element_domain :tmlt.core.domains.numpy_domains.NumpyDomain#

Domain of elements in the Series.

property carrier_type(self)#

Returns carrier type for members of the domain.

Return type

type

validate(self, value)#

Raises error if value is not a DataFrame with matching schema.

Parameters

value (Any) –

classmethod from_numpy_type(cls, dtype)#

Returns a Pandas Series from a NumPy type.

Parameters

dtype (numpy.dtype) –

Return type

PandasSeriesDomain

__contains__(self, value)#

Returns True if value is in the domain.

Parameters

value (Any) –

Return type

bool

class PandasDataFrameDomain#

Bases: tmlt.core.domains.base.Domain

Domain of Pandas DataFrames.

schema :PandasColumnsDescriptor#

Mapping from column name to column domain.

property carrier_type(self)#

Returns carrier type for the domain.

Return type

type

validate(self, value)#

Raises error if value is not a Pandas DataFrame with matching schema.

Parameters

value (Any) –

__eq__(self, other)#

Return True if the classes are equivalent.

Parameters

other (Any) –

Return type

bool

classmethod from_numpy_types(cls, dtypes)#

Returns a Pandas DataFrame domain from a dictionary of NumPy types.

Parameters

dtypes (Dict[str, numpy.dtype]) –

Return type

PandasDataFrameDomain

__contains__(self, value)#

Returns True if value is in the domain.

Parameters

value (Any) –

Return type

bool