qis.get_time_period¶
- qis.get_time_period(df=None, index=None, tz=None)[source]¶
the TimePeriod spanned by a frame’s index, or by an index directly.
TimePeriodis the house type for a date range, so this is the entry point that turns data into one. The timezone is inherited from the index unlesstzoverrides it, which keeps a localised panel from silently losing its zone downstream.- Parameters:
df (Series | DataFrame) – frame or series whose index defines the period. Takes precedence over
indexindex (DatetimeIndex) – index to read instead, when there is no frame to hand
tz (str) – timezone for the result. None inherits the index timezone
- Returns:
the period from the first to the last index entry, or an empty TimePeriod on an empty index
- Raises:
ValueError – if neither
dfnorindexis given- Return type: