title: How to estimate density function and calculate its peaks?
body: <p>I have started to use python for analysis. I would like to do the following:</p>
  
  <ol>
  <li>Get the distribution of dataset </li>
  <li>Get the peaks in this distribution</li>
  </ol>
  
  <p>I used gaussian_kde from scipy.stats to make estimation for kernel density function. Does guassian_kde make any assumption about the data ?. I am using data that are changed over time. so if data has one distribution (e.g. Gaussian), it could have another distribution later. Does gaussian_kde have any drawbacks in this scenario?. It was suggested in <a href="https://stackoverflow.com/questions/6620471/fitting-empirical-distribution-to-theoretical-ones-with-scipy-python">question</a> to try to fit the data in every distribution in order to get the data distribution. So what's the difference between using gaussian_kde and the answer provided in <a href="https://stackoverflow.com/questions/6620471/fitting-empirical-distribution-to-theoretical-ones-with-scipy-python">question</a>. I used the code below, I was wondering also to know is gaussian_kde good way to estimate pdf if the data will be changed over time ?. I know one advantage of gaussian_kde is that it calculate bandwidth automatically by a rule of thumb as in <a href="http://docs.scipy.org/doc/scipy-0.15.1/reference/generated/scipy.stats.gaussian_kde.html" rel="noreferrer">here</a>. Also, how can I get its peaks?</p>
  
  <pre><code>import pandas as pd
  import numpy as np
  import pylab as pl
  import scipy.stats
  df = pd.read_csv('D:\dataset.csv')
  pdf = scipy.stats.kde.gaussian_kde(df)
  x = np.linspace((df.min()-1),(df.max()+1), len(df)) 
  y = pdf(x)                          
  
  pl.plot(x, y, color = 'r') 
  pl.hist(data_column, normed= True)
  pl.show(block=True)       
  </code></pre>