Loading tutorials
pl.col. It also assumes you know that Polars runs expressions inside a context such as select or with_columns. Here the context is group_by(...).agg(...).4 min readgroup_by(...).agg(...) call and know that pl.col("x").sum() is an expression. Here you will put several summaries in one agg, restrict individual summaries to some rows, and avoid the naming and empty-group problems that come with both.3 min readgroup_by returns. It assumes you can write a basic group_by(...).agg(...) call, as covered in the previous chapters. Order does not change the numbers in your result. It changes which row appears first, and that matters when you compare outputs, wri5 min readpl.col, and read a group_by result. It also assumes you know what a key column is, meaning a column whose values identify the same ent4 min readinner and left joins from the previous chapter, can build a DataFrame, and can select columns with pl.col. Examples use a recent Polars 1.x release.5 min readinner and left joins with DataFrame.join, and that you know what a join key is. It covers four more join types. A full join keeps unmatched rows from both sides. Semi and anti joins filter one table using another. A cross join pairs every row with every5 min readpl.col, and use group_by with agg as covered earlier. The goal is to compute a per-group value, such as a total or a mean, and put it next to every original row without collapsing the table.5 min readover, which computes a per-group value and keeps every row. This chapter uses over with expressions that depend on row order or position: rank, shift, diff, and the cum_* family. This is the main way to answer "where does this row stand inside its group?" 4 min readover computing a per-group value and repeating it on every row. That behavior is one of three ways Polars can map a per-group result back onto a DataFrame. This chapter covers all three, the mapping_strategy argument that selects between them, and how to pick one.5 min readgroup_by and agg expressions and that you know over from the previous chapters. You should also be comfortable reading a DataFrame printout and know what a null is.5 min readgroup_by with agg, expressions such as pl.col("x").sum(), and how to build a DataFrame with a datetime column. It builds on the earlier chapter on rolling window expressions and shows how to bucket ordered data by time.4 min readjoin works (left and inner joins, on, how), and that you can build a DataFrame and write expressions with pl.col. It also assumes you have seen group_by_dynamic for time-ordered data. Examples use a recent Polars release.5 min readselect, with_columns, and agg expressions, and that you know the basics of group_by, joins, and over. Here you will compare the three tools and pick one for a given task.5 min readgroup_by, join, and over expressions on a DataFrame, and that you know what a column expression such as pl.col("sales").sum() is. Here you will run the same operations on a LazyFrame. You will also learn what the optimizer does with them, and which mist5 min read