Visualization
Back in Chapter 6, Visualization, we discussed at length visualization using matplotlib, and we even discussed using Seaborn for advanced plots. These tools are great for generating static charts, but when you want to add some level of interactivity, you will need to opt for other libraries.
For this recipe, we are going to load the same data from the vehicles dataset we used back in our Scatter plots recipe from Chapter 6:
df = pd.read_csv(
"data/vehicles.csv.zip",
dtype_backend="numpy_nullable",
dtype={
"rangeA": pd.StringDtype(),
"mfrCode": pd.StringDtype(),
"c240Dscr": pd.StringDtype(),
"c240bDscr": pd.StringDtype()
}
)
df.head()
barrels08 barrelsA08 charge120 … phevCity phevHwy phevComb
0 14.167143 0.0 0.0 … 0 0 0
1 27.046364 0.0 0.0 … 0 0 0
2 11.018889...