Technical requirements
You can download the datasets and code in the GitHub repository:
- Data: https://github.com/PacktPublishing/Polars-Cookbook/tree/main/data
- Code: https://github.com/PacktPublishing/Polars-Cookbook/tree/main/Chapter04
It is assumed that you have installed the Polars library in your Python environment:
>>> pip install polars
It is also assumed that you imported it in your code:
import polars as pl
In this chapter, we’ll be using the Contoso dataset (https://github.com/PacktPublishing/Polars-Cookbook/blob/main/data/contoso_sales.csv), which contains sales data. It also includes attributes such as products and customers and we’ll look at aggregating sales by these dimensions using various aggregation techniques.