Skip to content

Intermediate Data Visualization with Seaborn

Run the hidden code cell below to import the data used in this course.

# Importing the course packages
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns

# Importing the course datasets
bike_share = pd.read_csv('datasets/bike_share.csv')
college_data = pd.read_csv('datasets/college_datav3.csv')
daily_show = pd.read_csv('datasets/daily_show_guests_cleaned.csv')
insurance = pd.read_csv('datasets/insurance_premiums.csv')
grants = pd.read_csv('datasets/schoolimprovement2010grants.csv', index_col=0)

Take Notes

Add notes about the concepts you've learned and code cells with code you want to keep.

Add your notes here

import seaborn as sns
import matplotlib.pyplot as plt

diag_kws={'alpha':.5} # for pairplot alpha changes along diagonal plots (Probably has an offdiag 1)
plot_kws={'alpha':.5} # for pairplot alpha changes across all plots  

ax= sns.lmplot(data=bike_share,x='total_rentals', y='temp', col='workingday')
plt.show()

Explore Datasets

Use the DataFrames imported in the first cell to explore the data and practice your skills!

  • Use lmplot() to look at the relationship between temp and total_rentals from bike_share. Plot two regression lines for working and non-working days (workingday).
  • Create a heat map from daily_show to see how the types of guests (Group) have changed yearly.
  • Explore the variables from insurance and their relationship by creating pairwise plots and experimenting with different variables and types of plots. Additionally, you can use color to segment visually for region.
  • Make sure to add titles and labels to your plots and adjust their format for readability!