Generation

generate functionSat, 04 Mar 2023

Construct a line graph using the data from this dataframe, where the x-axis is years and the y-axis is the columns hapscore = pd.DataFrame({'2015': [df15['Happiness Score'].mean()], '2016': [df16['Happiness Score'].mean()], '2017': [df17['Happiness.Score'].mean()], '2018': [df18['Score'].mean()], '2019': [df19['Score'].mean()]}) 2015 2016 2017 2018 2019 0 5.375734 5.382185 5.354019 5.375917 5.407096

import matplotlib.pyplot as plt def happinessgraph(): hapscore.plot(kind='line') plt.xlabel("Years") plt.ylabel("Happiness Score") plt.title("Graph of Happiness Score over the Years") plt.show()

Questions about programming?Chat with your personal AI assistant