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
import retentioneering as rete
df = pd.read_csv("events.csv")
stream = rete.Eventstream(df)
No CSV yet? Use the built-in sample dataset to follow along:
import retentioneering as rete
stream = rete.datasets.load_ecom()
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 = (
rete.datasets.load_ecom()
.filter_events(drop={"event": ["checkout_bug"]})
.rename_events({"wishlist_add": "add_to_wishlist"})
)
stream.step_sankey()
Every processor returns a new eventstream, so they chain into a pipeline and never modify what they were called on. Note that they also validate event names against your data: dropping or renaming an event that isn't there raises an error instead of silently doing nothing.
Next steps
- Path Analysis — the one page that explains what all of these widgets actually compute. Read this before the rest.
- Eventstream — schema configuration and data format
- Widgets — all available visualizations and how they work
- Data Processors — full list of transformations