Package: temporian
Temporianis a library forsafe,simpleandefficientpreprocessing and feature engineering of temporal data in Python. Temporian supports multivariate time-series, multivariate time-sequences, event logs, and cross-source event streams.Temporian is totemporal datawhat Pandas is to tabular data.Key featuresSupports most types of temporal data📈: Handles both uniformly sampled and
non-uniformly sampled data, both single-variate and multivariate data, both flat
and multi-index data, and both mono-source and multi-source non-synchronized
events.Optimized for Temporal data🔥: Temporian's core computation is
implemented in C++ and optimized for temporal data. Temporian can be more than
1,000x faster than off-the-shelf data processing libraries when operating on
temporal data.Easy to integrate into an existing ML ecosystem: Temporian does not perform any ML model training - instead it integrates seamlessly with any ML library, such as PyTorch, Scikit-Learn, Jax, TensorFlow, XGBoost, or Yggdrasil Decision Forests.Prevents unwanted future leakage😰: Unless explicitly specified withtp.leak, feature computation cannot depend on future data, thereby preventing
unwanted, hard-to-debug, and potentially costly future leakage.QuickStartInstallationInstall Temporian fromPyPIwithpip:pipinstalltemporian-UTemporian is currently available for Linux and MacOS (ARM and Intel). Windows support is under development.Minimal exampleConsider sale records that contain contain thetimestamp,store, andrevenueof individual sales.$catsales.csv
timestamp,store,revenue2023-12-0421:21:05,STORE_31,50712023-11-0817:14:38,STORE_4,15712023-11-2921:44:46,STORE_49,61012023-12-2018:17:14,STORE_18,44992023-12-1510:55:09,STORE_2,6666
...Our goal is to compute the sum of revenue for each store at 11 pm every weekday (excluding weekends).First, we load the data and list the workdays.importtemporianastp# Load sale transactionssales=tp.from_csv("sales.csv")# Index sales per storesales_per_store=sales.add_index("store")# List work daysdays=sales_per_store.tick_calendar(hour=22)work_days=(days.calendar_day_of_week()<=5).filter()work_days.plot(max_num_plots=1)Then, we sum the daily revenue for each workday and each store.# Aggregate revenue per store and per work daydaily_revenue=sales_per_store["revenue"].moving_sum(tp.duration.days(1),sampling=work_days).rename("daily_revenue")# Plot the resultsdaily_revenue.plot(max_num_plots=3)Finally, we can export the result as a Pandas DataFrame for further processing or for consumption by other libraries.tp.to_pandas(daily_revenue)Check theGetting Started tutorialto find out more!Next stepsNew users should refer to theGetting Startedguide, which provides a
quick overview of the key concepts and operations of Temporian.After that, visit theUser Guidefor a deep dive into
the major concepts, operators, conventions, and practices of Temporian. For a
hands-on learning experience, work through theTutorialsor refer to theAPI
reference.DocumentationThe documentation 📚 is available attemporian.readthedocs.io. TheGetting Started guideis the best way to start.ContributingContributions to Temporian are welcome! Check out thecontributing guideto get started.CreditsTemporian is developed in collaboration between Google andTryolabs.