So this is how my dataset looks like but when i use
plot.line()
it gives me the error " no numeric data to plot"
apply to numeric doesn't seem to work
check if the below code helps.
import matplotlib.pyplot as plt
x = df.iloc[:,0]
y = df.iloc[:,1]
plt.scatter(x, y, s=area, c=colors, alpha=0.5)
plt.show()
df = df.head(50) now look how your plot is.df.plot("Country Name", "China")import matplotlib.pyplot as plt df = df.head(50) x = df.iloc[:,0] y = df.iloc[:,1] plt.scatter(x, y, s=area, c=colors, alpha=0.5) plt.show() can you try this?There are so, so many ways!
import seaborn as sns
sns.scatterplot(x="Country Name", y="China", data=df)
sns.lineplot(x="Country Name", y="China", data=df)
sns.barplot(x="Country Name", y="China", data=df)
See the links below for more info.
df.plot('Country Name' , 'China')