Suppose we have a dataset a are interested in plotting kde plot.
So this recipe is a short example on How to generate kernel density estimate plot using pandas on a column. Let's get started.
import pandas as pd import seaborn as sb
Let's pause and look at these imports. Pandas is generally used for performing mathematical operation and preferably over arrays. Seaborn is just used in here to import dataset.
df = sb.load_dataset('tips')
Here we have imported tips dataset from seaborn library.
Now our dataset is ready.
Here we first converted our total_bill to float type data. Then using seaborn library itself, plotted our kde plot.
Once we run the above code snippet, we will see:
Scroll down to the ipython file to look at the results.
We can see kde plot being plotted for total_bill.