MulaiMulai sekarang secara gratis

Does sugar improve happiness?

A new column has been added to world_happiness called grams_sugar_per_day, which contains the average amount of sugar eaten per person per day in each country. In this exercise, you'll examine the effect of a country's average sugar consumption on its happiness score.

pandas as pd, matplotlib.pyplot as plt, and seaborn as sns are imported, and world_happiness is loaded.

Latihan ini adalah bagian dari kursus

Introduction to Statistics in Python

Lihat Kursus

Latihan interaktif praktis

Cobalah latihan ini dengan menyelesaikan kode contoh berikut.

# Scatterplot of grams_sugar_per_day and happiness_score
____
plt.show()

# Correlation between grams_sugar_per_day and happiness_score
cor = ____
print(cor)
Edit dan Jalankan Kode