Inspecting the DataFrame
The first thing you need to do is to understand what your data looks like. Understanding things such as the schema and basic statistics of your data helps you see the current state of your data. Only then will you be able to see what data operations you’d need to make your data clean and organized for analysis.
In this recipe, we’ll cover ways to return a few rows from the dataset, as well as learning how to generate summary statistics and check the column quality.
How to do it...
We’ll first read the data and start exploring the DataFrame:
- Read the dataset:
df = pl.read_csv('../data/covid_19_deaths.csv')
- Display the first five rows:
df.head(5)
The preceding code will return the following output:
Figure 3.1 – The first five rows of the DataFrame
- Display the last n rows:
df.tail(5)
The preceding code will return the following output:
Figure...