title: Why am I getting the "ValueError: data type <class 'numpy.object_'> not inexact." while using polyfit function?
body: <p>I am trying to plot a trendline for my data. However, I am getting the error</p>
  <pre><code>ValueError: data type &lt;class 'numpy.object_'&gt; not inexact.  
  </code></pre>
  <p>Can someone explain why?</p>
  <p>my dataframe is Us_corr3;</p>
  <p><img src="https://i.stack.imgur.com/3XGWZ.png" alt="enter image description here" /><br />
  Here is my code:</p>
  <pre><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),&quot;r--&quot;)
  
  plt.show()
  </code></pre>
  <p>And it says;</p>
  <pre><code>ValueError: data type &lt;class 'numpy.object_'&gt; not inexact.
  </code></pre>