After transposing a dataframe with the following code:
groupedt = grouped.set_index('StateName').T
groupedt = groupedt.reset_index()
I have this resulting dataframe:
Is there a way for me to plot a line graph with every state on it that includes a legend of the states? I currently have the following code:
plt.figure(figsize=(16,6))
plt.plot(groupedt['index'], groupedt[groupedt.columns[2:41]])
plt.show()
which plots the time series for every state but I am not sure how I can create a legend that shows which state is which color?

