pandas.Period.start_time#
- Period.start_time#
Get the Timestamp for the start of the period.
This property returns the exact start time of the period as a Timestamp. For example, a monthly period starting in January 2020 would return a Timestamp of ‘2020-01-01 00:00:00’.
- Returns:
- Timestamp or Series
A Timestamp for a Period, or a Series of datetimes when called through
Series.dt.
See also
Period.end_timeReturn the end Timestamp.
Period.dayofyearReturn the day of year.
Period.daysinmonthReturn the days in that month.
Period.dayofweekReturn the day of the week.
Examples
For Period:
>>> period = pd.Period('2012-1-1', freq='D') >>> period Period('2012-01-01', 'D')
>>> period.start_time Timestamp('2012-01-01 00:00:00')
>>> period.end_time Timestamp('2012-01-01 23:59:59.999999')
For Series:
>>> ser = pd.Series(pd.period_range("2020-01", periods=3, freq="M")) >>> ser.dt.start_time 0 2020-01-01 1 2020-02-01 2 2020-03-01 dtype: datetime64[us]