Histogram python
Histogram: a graphical display of data using bars of different heights. It is similar to a Bar Chart, but a histogram group’s numbers into ranges. The height of each bar shows how many fall into each range.
Histograms are a great way to show results of continuous data, such as:
Weight, height etc.
The range of each bar is also called the class Interval
To create a histogram the first step is to create bin of the ranges, then distribute the whole range of the values into a series of intervals, and the count the values which fall into each of the intervals. Bins are clearly identified as consecutive, non-overlapping intervals of variables.
Creation of Histogram
hist() function
Syntax hist(x-axis,y-axis)
X= bins or say interval
Y=data
Histograms are commonly used to demonstrate how many of a certain type of variable occurs within a specific range.
Following example plots a histogram of marks obtained by students in a class XII Four bins, 0-25, 26-50, 51-75, and 76-100 are defined. The Histogram shows number of students falling in this range
Marks
22
87
5
43
56
73
55
54
11
20
51
5
79
31
27
Working
Intervals / Bins Frequency Range (No of Children in Each Range)
0-25 1111 1 5
26-50 111 3
51-75 1111 1 5
76-100 11 2
To construct a histogram, the first step is to "bin" (or "bucket") the range of values—that is, divide the entire range of values into a series of intervals.
If marks- distribution / Bins is not given
number of observations= 15
Range =Max value - Min Value 87-5= 82
Intervals √15 = 3.8729 or say 4
Width of intervals = Range / intervals 82/4 =21.1723
Now calculate values for bins
Steps to plot a histogram in Python using Matplotlib
1. Step 1: Install the Matplotlib package. ...
2. Step 2: Collect the data for the histogram. ...
3. Step 3: Determine the number of bins. ...
4. Step 4: Plot the histogram in Python using matplotlib.
import matplotlib.pyplot as pl
import numpy as np
a = np.array([22,10,50,43,89,73,55,54,11,20,31,67,79,90,72])
pl.hist(a, bins = [0,25,50,75,100],color="r",rwidth=0.9)
pl.title("Result")
pl.xticks([0,25,50,75,100])
pl.xlabel('marks')
pl.ylabel('no. of students')
pl.show()
Что делает видео по-настоящему запоминающимся? Наверное, та самая атмосфера, которая заставляет забыть о времени. Когда вы заходите на RUVIDEO, чтобы посмотреть онлайн «Histogram python», вы рассчитываете на нечто большее, чем просто загрузку плеера. И мы это понимаем. Контент такого уровня заслуживает того, чтобы его смотрели в HD 1080, без дрожания картинки и бесконечного буферизации.
Честно говоря, Rutube сегодня — это кладезь уникальных находок, которые часто теряются в общем шуме. Мы же вытаскиваем на поверхность самое интересное. Будь то динамичный экшн, глубокий разбор темы от любимого автора или просто уютное видео для настроения — всё это доступно здесь бесплатно и без лишних формальностей. Никаких «заполните анкету, чтобы продолжить». Только вы, ваш экран и качественный поток.
Если вас зацепило это видео, не забудьте взглянуть на похожие материалы в блоке справа. Мы откалибровали наши алгоритмы так, чтобы они подбирали контент не просто «по тегам», а по настроению и смыслу. Ведь в конечном итоге, онлайн-кинотеатр — это не склад файлов, а место, где каждый вечер можно найти свою историю. Приятного вам отдыха на RUVIDEO!
Видео взято из открытых источников Rutube. Если вы правообладатель, обратитесь к первоисточнику.