- Trending Categories
- Data Structure
- Operating System
- C Programming
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How can Seaborn library be used to display kernel density estimations in Python?
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()
- The required packages are imported.
- The input data is ‘iris_data’ which is loaded from the scikit learn library.
- The ‘load_dataset’ function is used to load the iris data.
- This data is visualized using the ‘distplot’ function.
- Here, the parameter ‘kde’ is set to true since we only want to display the histogram.
- This visual data is displayed on the console.
Note − When the value of ‘kde’ is specified as False, only the histogram is displayed.
- How Seaborn library used to display a kernel density estimation plot (joinplot) in Python?
- How can Seaborn library be used to display a Scatter Plot in Python?
- How can Seaborn library be used to display a hexbin plot in Python?
- How can Seaborn library be used to display categorical scatter plots in Python?
- How can bar plot be used in Seaborn library in Python?
- How can Seaborn library be used to visualize point plots in Python?
- How can FacetGrid be used to visualize data in Python Seaborn Library?
- How can seaborn library be used to display data without the background axis spines in Python?
- How can the countplot be used to visualize data in Python Seaborn Library?
- How can factorplot be used in Seaborn to visualize data in Python?
- How can scikit learn library be used to preprocess data in Python?
- How can scikit-learn library be used to load data in Python?
- How can Bokeh library be used to generate line graphs in Python?
- How can Bokeh library be used to visualize twin axes in Python?
- How can data be represented visually using ‘seaborn’ library in Python?