I am trying to plot a trendline for my data. However, I am getting the error
ValueError: data type <class 'numpy.object_'> not inexact.
Can someone explain why?
my dataframe is Us_corr3;

Here is my code:
data5 = Us_corr3[['US GDP', 'US Unemployment']]
x = data5['US GDP']
y = data5['US Unemployment']
plt.scatter(x, y)
z = np.polyfit(x, y, 1)
p = np.poly1d(z)
plt.plot(x,p(x),"r--")
plt.show()
And it says;
ValueError: data type <class 'numpy.object_'> not inexact.