Carrying on from the last blog post, I am now going to shift attention to plotting categorical data with Seaborn. So let’s write our first few lines of code that deals with the import of various packages and loads our excel file into a DataFrame. The excel file we are using can be downloaded by clicking the download link below.
import pandas as pd import seaborn as sns #if using Jupyter Notebooks the below line allows us to display charts in the browser %matplotlib inline #load our data in a Pandas DataFrame df = pd.read_excel('Financial Sample.xlsx') #set the style we wish to use for our plots sns.set_style("darkgrid") #print first 5 rows of data to ensure it is loaded correctly df.head()
