timeseriesx.validation package
Submodules
timeseriesx.validation.frequency module
- timeseriesx.validation.frequency.coerce_freq(freq)[source]
return a convenient representation of a frequency as a pandas.DateOffset object
- Parameters
freq (str/datetime.timedelta/pandas.Timedelta/pandas.DateOffset) – a frequency string or frequency object to coerce
- Returns
coerced frequency object
- Return type
pandas.DateOffset
timeseriesx.validation.time_zone module
- timeseriesx.validation.time_zone.coerce_time_zone(tz)[source]
returns the convenient representation of a time zone as a pytz-based tzinfo-object
- Parameters
tz (str/datetime.tzinfo) –
- Returns
the coerced time zone object
- Return type
datetime.tzinfo
timeseriesx.validation.timestamp_index module
- timeseriesx.validation.timestamp_index.index_is_datetime(series, exception=True)[source]
check if the index of a pandas.Series is a valid DatetimeIndex
- Parameters
series (pandas.Series) – the series holding the index to check
exception (bool) – if True, raise an exception in case of invalid DatetimeIndex
- Returns
True if index is a valid DatetimeIndex, False otherwise.
- Return type
bool
- timeseriesx.validation.timestamp_index.index_is_sorted(series, ascending=True, exception=True)[source]
check if the (datetime-) index of a pandas.Series is sorted
- Parameters
series (pandas.Series) – the series holding the index to check
ascending (bool) – if true, check for ascending order, if false for descending order
exception (bool) – if True, raise an exception in case of unsorted index
- Returns
True if index is sorted, False otherwise.
- Return type
bool