modin.pandas.DatetimeIndex.to_period¶
- DatetimeIndex.to_period(freq=None) Index[source] (https://github.com/snowflakedb/snowpark-python/blob/v1.47.0/src/snowflake/snowpark/modin/plugin/extensions/datetime_index.py#L368-L370)¶
Cast to PeriodArray/PeriodIndex at a particular frequency.
Converts DatetimeArray/Index to PeriodArray/PeriodIndex.
- Parameters:
freq (str or Period, optional) – One of pandas’ period aliases or a Period object. Will be inferred by default.
- Return type:
PeriodArray/PeriodIndex
- Raises:
ValueError – When converting a DatetimeArray/Index with non-regular values, so that a frequency cannot be inferred.
See also
PeriodIndexImmutable ndarray holding ordinal values.
DatetimeIndex.to_pydatetimeReturn DatetimeIndex as object.
Examples
Infer the daily frequency