'Seaborn - TypeError: Invalid object type at position 0

I have a dataframe which looks like:

df_g_fcl.head()
Out[47]:
month_year  producttype fpd_30  fpd_90  fstpd_90
4   2020-01 FCL 70.0    10.0    10.0
11  2020-02 FCL 9.0     0.0     0.0
18  2020-03 FCL 28.0    6.0     15.0
25  2020-04 FCL 14.0    3.0     11.0
33  2020-05 FCL 10.0    4.0     14.0

And I want to display a chart x=month_year, y=fpd_30 with forecast.

I tried:

plt.figure(figsize=(21, 8))
ax = sns.lineplot(x='month_year', y='fpd_30', data=df_g_fcl)
ax.tick_params(axis='x', labelrotation=90)

which yielded:

TypeError: Invalid object type at position 0

Help would be appreciated.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source