Getting ready

We will consider an example of the number of batteries sold in each year, with different ampere hour (Ah) ratings. There are two categorical variables: year and Ah ratings, and one numeric variable: the number of batteries sold.

Import the required libraries:

import numpy as np
import matplotlib.pyplot as plt