pandera.engines.xarray_engine.DataTypeΒΆ

class pandera.engines.xarray_engine.DataType(dtype)[source]ΒΆ

xarray-compatible data type.

Delegates to numpy_engine for dtype resolution since xarray arrays are typically backed by NumPy or duck arrays with NumPy-like dtypes.

Attributes

auto_coerce

Whether to force coerce to be True in all cases

continuous

Whether the number data type is continuous.

type

Native numpy dtype boxed by the data type.

Methods

__init__(dtype)[source]ΒΆ
check(pandera_dtype, data_container=None)[source]ΒΆ

Check if the DataArray dtype matches.

Return type:

bool

coerce(data_container)[source]ΒΆ

Coerce a DataArray to the specified dtype.

Return type:

DataArray

coerce_value(value)[source]ΒΆ

Coerce an value to a particular type.

Return type:

Any

try_coerce(data_container)[source]ΒΆ

Coerce data container to the data type, raises a ParserError if the coercion fails :raises: ParserError: if coercion fails

Return type:

Union[Series, DataFrame, ndarray]

__call__(data_container)[source]ΒΆ

Coerce data container to the data type.