Returns a summary of the date-related information, including the number of dates, the time zone, the start date, and the end date.
Parameters
Name
Type
Description
Default
idx
pd.Series or pd.DateTimeIndex
The parameter idx can be either a pandas Series or a pandas DateTimeIndex. It represents the dates or timestamps for which we want to generate a summary.
required
engine
str
The engine parameter is used to specify the engine to use for generating a date summary. It can be either โpandasโ or โpolarsโ. - The default value is โpandasโ. - When โpolarsโ, the function will internally use the polars library for generating a date summary.
'pandas'
Returns
Type
Description
pd.DataFrame
A pandas DataFrame with the following columns: - date_n: The number of dates in the index. - date_tz: The time zone of the dates in the index. - date_start: The first date in the index. - date_end: The last date in the index.
Examples
import pytimetk as tkimport pandas as pddf = tk.load_dataset('bike_sales_sample', parse_dates = ['order_date'])tk.get_date_summary(df['order_date'], engine='pandas')tk.get_date_summary(df['order_date'], engine='polars')