MulaiMulai sekarang secara gratis

Visualizing variable relationships

In the last exercise, you may have noticed that a longer marriage_duration is correlated with having more children, represented by the num_kids column. The correlation coefficient between the marriage_duration and num_kids variables is 0.45.

In this exercise, you'll create a scatter plot to visualize the relationship between these variables. pandas has been loaded as pd, matplotlib.pyplot has been loaded as plt, and Seaborn has been loaded as sns. The dataset name is divorce.

Latihan ini adalah bagian dari kursus

Exploratory Data Analysis in Python

Lihat Kursus

Petunjuk latihan

  • Create a scatterplot showing marriage_duration on the x-axis and num_kids on the y-axis.

Latihan interaktif praktis

Cobalah latihan ini dengan menyelesaikan kode contoh berikut.

# Create the scatterplot
____
plt.show()
Edit dan Jalankan Kode