The time series toolkit for Python
This library is currently under development and is not intended for general usage yet. Functionality is experimental until release 0.1.0.
To install timetk
using Poetry, follow these steps:
Make sure you have Python 3.9 or later installed on your system.
To install Poetry, you can use the official installer provided by Poetry. Do not use pip.
Clone the timetk
repository from GitHub:
git clone https://github.com/business-science/pytimetk
Use Poetry to install the package and its dependencies:
install poetry
or you can create a virtualenv with poetry and install the dependencies
poetry shell
poetry install
This is a simple code to test the function summarize_by_time
:
import timetk
import pandas as pd
df = timetk.data.load_dataset('bike_sales_sample')
df['order_date'] = pd.to_datetime(df['order_date'])
df \
.summarize_by_time(
date_column='order_date',
value_column= 'total_price',
groups = "category_2",
freq = "M",
kind = 'timestamp',
agg_func = ['mean', 'sum']
)