Skip to article frontmatterSkip to article content
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import seaborn as sns
from vega_datasets import data

# if vega_datasets is not installed, you can install it from the
# notebook with
# %pip install vega_datasets
# restart the kernel after installation

let’s load the cars dataset

cars = data.cars()

Explore the shape and first few lines of the dataset

# your code

Compute the mean and std for numeric columns

# your code

Put the name of the columns labels in lower case

# your code
# check it
cars.head(2)
Loading...

Create a column “consommation (l/km)”, and remove the column miles_per_gallon

Tip: miles_per_gallon/235.2 = litre_per_100km

# your code

Create a columns “poids (kg)” and remove the column weight_in_lbs

Tip: 1lb = 0.454 kg

# your code

Count the number of different origin

# your code

Check the memory usage of the origin column, convert the column ‘origin’ to category, check the new memory usage*

# your code