What is Histogram?

 Histogram 

A Histogram is a graphical representation of the distribution of a dataset. It divides the range of data into bins(intervals) and displays how many points falls into each bin.

key components:

bins: The intervals in which the data range is divided.

frequency: count of data points in each bin.

Vizualization: Typically represented as a bar chart.


Python

import matplotlib.pyplot as plt                                                                                                
data = [1,2,3,4,5,6,7,8,....]                                                                                                       
plt.hist(data, bins = 5, color = 'blue', edgecolor = 'black')                                                      
plt.title()                                                                                                                                  
plt.xlabel()                                                                                                                              
plt.ylabel()                                                                                                                              
plt.show()                                                                                                                                

Explanation:

Output:

Types of Histograms

1. bell shaped histogram
2. bimodal histogram
3. skewed right histogram
4. skewed left histogram
5. uniform histogram

Significance of Histograms:

1. Understanding the data distribution

The shape of a histogram reveals the underlying distribution of data, which is essential for statistical analysis. Common distributions include:

Normal distribution
uniform distribution
Bimodal distribution

2. Identifying the Central tendency

3. Understanding the Variability

The width of the histogram (spread of bins) indicates variability or dispersion

4. Detecting Outliers


Resources:

1. https://www.cuemath.com/data/histograms/ 

Popular Post

MindMaps

Featured post

Question 1: Reverse Words in a String III

  def reverseWords(s: str) -> str: words = s.split() return ' '.join(word[::-1] for word in words)