pandera.engines.pandas_engine.DateTimeΒΆ
- class pandera.engines.pandas_engine.DateTime(to_datetime_kwargs=<factory>, unit='ns', tz=None, time_zone_agnostic=False, tz_localize_kwargs=<factory>)[source]ΒΆ
Semantic representation of a potentially timezone-aware datetime.
Uses
np.dtype("datetime64[ns]")for non-timezone aware datetimes andpandas.DatetimeTZDtypefor timezone-aware datetimes.Attributes
auto_coerceWhether to force coerce to be True in all cases
continuousWhether the number data type is continuous.
time_zone_agnosticA flag indicating whether the datetime data should be handled flexibly with respect to timezones.
typeNative pandas dtype boxed by the data type.
tzThe timezone.
unitThe precision of the datetime data.
to_datetime_kwargsAny additional kwargs passed to
pandas.to_datetime()for coercion.tz_localize_kwargsKeyword arguments passed to
pandas.Series.dt.tz_localize()for coercion.Methods
- __init__(to_datetime_kwargs=<factory>, unit='ns', tz=None, time_zone_agnostic=False, tz_localize_kwargs=<factory>)[source]ΒΆ
- check(pandera_dtype, data_container=None)[source]ΒΆ
Check that pandera
DataTypeare equivalent.- Parameters:
- Return type:
- Returns:
boolean scalar or iterable of boolean scalars, indicating which elements passed the check.
- classmethod from_parametrized_dtype(pd_dtype)[source]ΒΆ
Convert a
pandas.DatetimeTZDtypeto a Panderapandera.engines.pandas_engine.DateTime.