Technical requirements
You can download the datasets and code from the GitHub repository:
- Data: https://github.com/PacktPublishing/Polars-Cookbook/tree/main/data
- Code: https://github.com/PacktPublishing/Polars-Cookbook/tree/main/Chapter06
It is assumed that you have installed the Polars library in your Python environment:
>>> pip install polars
It is also assumed that you have imported it into your code:
import polars as pl
We’ll be using the Google Play Store Reviews dataset throughout this chapter, which can be found here: https://github.com/PacktPublishing/Polars-Cookbook/blob/main/data/google_store_reviews.csv.
Read the dataset into a DataFrame:
df = pl.read_csv('../data/google_store_reviews.csv')
Let’s change the length of a string that Polars will show in a DataFrame. For Jupyter notebooks, you need to change the environmental variable directly:
import os os.environ['POLARS_FMT_STR_LEN'] = str...