ComeçarComece de graça

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()

Este exercício faz parte do curso

Python for R Users

Ver curso

Exercício interativo prático

Experimente este exercício completando este código de exemplo.

import matplotlib.pyplot as plt

# Scatter plot between the tip and total_bill
tips.plot(____, ____, ____)
plt.show()
Editar e executar o código