I have a pandas data frame in this form:
Country Year Value
0 Thailand 1989 48587.03
1 Thailand 1990 55903.07
2 Vietnam 1989 100290.04
3 Vietnam 1990 118873.59
4 India 1989 147383.02
5 India 1990 178230.05
The dtype of the values in Value
is float.
I am using seaborn to float this:
sns.lineplot(x='Year', y='Value', hue='Country', data=topfiveot)
And got an error:
DataError: No numeric types to aggregate
What possibly has caused the issue?
I think this error has more to do with pandas.groupby() than with seaborn itself. Checking to make sure that all of my numeric columns were floats worked for me. In your case
df.Year = df.Year.astype(float)
and
df.Values = df.Values.astype(float)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With