Histogram Python Matplotlib ML AI tutorial videos 1

Histogram python matplotlib ml ai tutorial videos 1

In this video, we are going to draw a histogram with dummy data. You can the data of your choice.

You need to install matplotlib first.

pip install matplotlib

we create a dummy array like this. You can create any array

x=[22,33,63,55,75,86,76,54,32,21,12]

hist() function

with the help of hist() we will draw histogram

it take 2 parameters:

  1. array of data we want to plot
  2. Number of bars in histogram

final step is to show histogram on screen.

 

Here is video Video link

Source Code


# lets create histogram in python
import matplotlib.pyplot as plt
# now we will create array for our histogram
x=[2,3,44,66,56,34,86,57,34,27]
# now we will use hist function to create diagram
plt.hist(x,10)
# first values x is array we want to plot
# second value/parameter is number of bars
# now we will show it on screen
plt.show()

 

Tony BB
 

TonyBB is a Coach , marketer, hypnotist and a founder of RSKVF Production who specializes in providing simple, affordable, and easy to use solutions for Life.

Click Here to Leave a Comment Below 0 comments

Leave a Reply: