Country Month GDPA
USA January 5
USA February 10
USA March 5
Canada January 7
Canada February 4
Canada March 10
Mexico January 9
Mexico February 17
Mexico March 8
Above is my data frame.
I want to make a line graph of the df. Where the x axis is the variable Month. The y axis is GDPA. And there are three separate lines for each country. Preferably using matplotlib only.
plt.plot(df[‘Country’], df[‘GDPA’], df[‘Month’]
My code above does not produce the expected graph because the lines are connected and it doesn’t even take the GDPA values into account.
I want it so that the
x axis is: January February March
y axis is GDPA values.
and there are 3 lines (for each country)

