Series in Python
A Polars Series is a typed, named column backed by Arrow memory.
import polars as pl
runs = pl.Series("tpm", [91, 104, 88])
print(runs.dtype, runs.name, len(runs))
print(runs.mean(), runs.max(), runs.std().__round__(2))
print((runs > 90).to_list())
print(runs.cast(pl.Float64).to_list())
How it works
- The dtype is part of the Series, and it is strict.
- Arithmetic and comparisons return new Series.
to_listis the escape hatch back to Python objects.
Keywords and builtins used here
aslenprint
The run, in numbers
- Lines
- 8
- Characters to type
- 224
- Tokens
- 89
- Three-star pace
- 100 tpm
At the three-star pace of 100 tokens a minute, this run takes about 53 seconds.
Step 1 of 4 in Series & frames, step 1 of 32 in Polars.