October 2018
Beginner to intermediate
676 pages
18h 30m
English
Import the required libraries. Set the background style and prepare the data required for plotting the graphs.
We will use the same long format DataFrame as input, group by Item and Quarter to get quarter-wise sales of various items, and create a pivot table out of it, still in the DataFrame format, which can be fed to the Seaborn plots:
import matplotlib.pyplot as pltimport seaborn as snssns.set(style='white')# Prepare the data in matrix format with Quartes on rows and Items in columnssales = pd.DataFrame(long_sales.groupby(["Item", "Quarter"]).Sales.mean())sales = sales.reset_index()sales = sales.pivot('Quarter','Item', 'Sales')sales.head()
Read now
Unlock full access