Session Ready
Exercise

Bivariate plots in pandas

Comparing multiple variables simultaneously is also another useful way to understand your data. When you have two continuous variables, a scatter plot is usually used.

# Scatter plot
df.plot(x='x_column', y='y_column', kind='scatter')
plt.show()

You can use a boxplot to compare one continuous and one categorical variable. However, you will be using the .boxplot() method instead of the .plot() method.

# Boxplot
df.boxplot(column='y_column', by='x_axis')
plt.show()
Instructions 1/2
undefined XP
  • 1
  • 2

Create a scatter plot with 'tip' on the y-axis and 'total_bill' on the x-axis.