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 2015 2016 2017 2018 2019 0 5.375734 5.382185 5.354019 5.375917 5.407096

import matplotlib.pyplot as plt def linegraph(df): plt.plot(df.index, df['2015'], label = "2015") plt.plot(df.index, df['2016'], label = "2016") plt.plot(df.index, df['2017'], label = "2017") plt.plot(df.index, df['2018'], label = "2018") plt.plot(df.index, df['2019'], label = "2019") plt.legend() plt.show() linegraph(df)

Questions about programming?Chat with your personal AI assistant