Loading tutorials
Series, which holds one column, and the DataFrame, which holds several columns of equal length. Everything else in the library, including expressions, contexts, joins and the lazy API, operates on these two types. This chapter covers how to creat5 min readselect, with_columns, filter) in detail. The next chapter 5 min readpl.col(...) expression, as covered in the previous chapters. It also assumes you know Python method chaining. It explains what a context is, how the three most common contexts differ, and which errors you will hit if you treat them l4 min readselect and with_columns calls with pl.col, and that you know Polars infers a dtype for every column. You don't need to know the selectors module. By the end you will be able to pick columns by name, regex, dtype or name pattern, and to combine those picks wit4 min readpl.col and use select, with_columns and filter. It covers the Polars way to build a column whose value depends on a condition, and the mistakes that usually come with it.4 min readpl.col, and use select, with_columns and filter. It covers how Polars represents missing data, how nulls behave in common operations, and how to handle them deliberately.4 min read"2024-03-01", timestamps with no time zone. Polars handles this with namespaces, which are groups of methods attached to an expression. This chapter covers the str and dt namespaces.5 min readpl.col, and use select, with_columns and filter. If those are new, review the earlier chapters first. Here you will learn how group_by works as a context, how to write several aggregations at once, and which mistakes ca5 min readpl.col, use select and with_columns, and run group_by(...).agg(...). The examples use the same small DataFrame as the earlier ch5 min readselect, with_columns, filter) and how group_by works. It also assumes you can read a DataFrame schema. Joins combine two DataFrames by matching values in key columns. In Polars they are DataFrame methods, not expressions, so they sit outside the co4 min readDataFrame.pivot and DataFrame.unpivot. It assumes you know how to build a DataFrame, how group_by and agg work, and what a null is in Polars. Examples use Polars 1.x, where pivot takes on= and unpivot replaced the older5 min readselect, with_columns, filter and group_by on an eager DataFrame. It also assumes you have run pl.read_csv. Everything below uses the same expressions you already know. What changes is when they run.5 min readselect, filter and group_by. It also assumes you have seen collect() on a lazy query. Here you will learn how Polars turns a CSV file into a DataFrame, how type inference can go wrong, and whe5 min readscan_csv, filter, group_by and agg, and call collect(). You should also know what an expression is. You do not need to know anything about database internals.5 min readselect, with_columns, filter, group_by), when/then/otherwise, and the basic lazy API. Examples use the df from earlier chapters and a recent Polars 1.x release.5 min read