Using scatter plots to view bivariate relationships between continuous features
In this section, we'll learn how to get a scatter plot of our data.
We can use scatter plots to get a more complete picture of the relationship between two features than what can be detected by a correlation coefficient alone. This is particularly useful when that relationship changes across certain ranges of the data. In this section, we will create scatter plots of some of the same features we examined in the previous section. Let's get started:
- It is helpful to plot a regression line through the data points. We can do this with Seaborn's
regplot
method. Let's load the COVID-19 data again, along with the Matplotlib and Seaborn libraries, and generate a scatter plot oftotal_cases_mill
bytotal_deaths_mill
:import pandas as pd import numpy as np import matplotlib.pyplot as plt import seaborn as sns covidtotals = pd.read_csv("data/covidtotals.csv") covidtotals.set_index...