Quick Start
This guide walks you through a complete example — from installation to your first interactive visualization — in under five minutes.
1. Install
pip install retentioneering
2. Load your data
Create an Eventstream from a pandas DataFrame. By default, Eventstream expects columns named user_id, event, and timestamp. If your data uses different column names, pass a schema.
import pandas as pd
from retentioneering import Eventstream
df = pd.read_csv("events.csv")
stream = Eventstream(df)
No CSV yet? Use the built-in sample dataset to follow along:
from retentioneering.datasets.ecom import load_ecom
from retentioneering import Eventstream
df = load_ecom()
stream = Eventstream(df, schema={
"path_cols": ["user_id"],
"segment_cols": ["platform", "acquisition_channel"],
})
3. Explore with a widget
Open an interactive Transition Graph — no arguments needed. Configure everything in the sidebar.
stream.transition_graph()
Compare two user segments side by side:
stream.transition_graph(diff=["platform", "mobile", "desktop"])
Explore user paths step by step around important events or drop-off points with Step Sankey:
stream.step_sankey(path_pattern=".*->purchase")
or its equivalent Step Matrix:
stream.step_matrix(path_pattern=".*->purchase")
4. Prepare your data
Use data processors to clean and shape the eventstream before visualizing:
stream = (
Eventstream(df)
.filter_events(drop={"event": ["bot_ping"]})
.rename_events({"btn_click": "button_click"})
)
stream.step_sankey()
Next steps
- Eventstream — schema configuration and data format
- Widgets — all available visualizations and how they work
- Data Processors — full list of transformations