van dam
van dam

Reputation: 69

How to plot this dataset? (error: no numeric data to plot)

enter image description here 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

Upvotes: 0

Views: 180

Answers (2)

ASH
ASH

Reputation: 20342

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.

https://www.python-graph-gallery.com/

https://seaborn.pydata.org/tutorial/introduction

Upvotes: 0

Harishma Ashok
Harishma Ashok

Reputation: 51

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()

Upvotes: 1

Related Questions