title: How to get probability density function using scipy gaussian_kde?
body: <p>I have a 1D data set which is saved in a 1D list. What is the best way to get the probability density function? I tried the usual approach of using scipy gaussian_kde.</p>
  
  <pre><code>array = np.array(values)
  kde = gaussian_kde(array)
  x = np.linspace(0, 50, 500)
  plt.plot(x, kde(x), label="", color="blue")
  plt.legend(loc='best')
  plt.show()
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/sT063.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/sT063.png" alt="Output"></a></p>
  
  <p>Produced graph is not the expected probability density function, since probability density functions should have a value between 0 and 1 for each x. </p>
  
  <p>Thanks</p>