Visualizing data is an important step since it helps understand what is going on in the data without actually looking at the numbers and performing complicated computations. Seaborn is a library that helps in visualizing data. It comes with customized themes and a high-level interface.
Kernel Density Estimation, also known as KDE is a method in which the probability density function of a continuous random variable can be estimated.
This method is used for the analysis of the non-parametric values. While using ‘distplot’, if the argument ‘kde’ is set to True and ‘hist’ is set to False, the KDE can be visualized.
Let us see how we can visualize a kernel density estimation in Python −
import pandas as pd import seaborn as sb from matplotlib import pyplot as plt df = sb.load_dataset('iris') sb.distplot(df['petal_length'],kde = True, hist = False) plt.show()
Note − When the value of ‘kde’ is specified as False, only the histogram is displayed.