Grouping and Aggregation in IronPython QuickStart Sample
Illustrates how to group data and how to compute aggregates over groups and entire datasets. in IronPython.
This sample is also available in: C#, Visual Basic, F#.
Overview
This QuickStart sample demonstrates how to perform grouping operations and compute aggregate statistics on datasets using Numerics.NET.
The sample uses the classic Titanic dataset to illustrate various grouping and aggregation techniques. It covers:
- Computing basic statistics like mean, count and standard deviation across entire datasets
- Creating custom aggregation functions for specialized calculations
- Grouping data by categorical variables and computing group-wise statistics
- Working with different types of windows including:
- Moving (rolling) windows for time series analysis
- Expanding windows that grow over time
- Fixed-width time windows
- Resampling time series data to different frequencies
- Creating pivot tables for cross-tabulation analysis
The sample shows both simple aggregations on vectors and matrices as well as more complex operations on data frames. It demonstrates how to work with datetime indexes and time-based groupings, which are essential for time series analysis. The code includes examples of computing survival rates by passenger class in the Titanic dataset using different approaches, showing the flexibility of the grouping and aggregation capabilities in Numerics.NET.
The code
Coming soon...