0% found this document useful (0 votes)
40 views4 pages

XIIInfo Pract 37

12 ip

Uploaded by

preeti
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
40 views4 pages

XIIInfo Pract 37

12 ip

Uploaded by

preeti
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Downloaded from www.tutorialaicsip.

com
Important QnA Histogram for Class 12 IP
Important QnA Histogram for Class 12 IP which is part of Chapter 3 Plotting with Pyplot.
So here we go!

Important QnA Histogram for Class 12 IP - Objective type questions (1 Mark)

Fill in the blanks, MCQs and True/False

[1] A __________ is a tool that summarize discrete or continuous data.

--> Histogram

[2] The numerical data shown by the number of data points that fall within a particular range
is called _______.

--> bins

[3] A histogram is a similar to a vertical bar graph. [True/False]

[4] Which of the following data can be shown by histogram?

a) The quantity like weight, height, time

b) The categories

c) The uncountable data

d) All of these

[5] The histogram was introduced by _________

--> Karl Pearson

[6] A ______ function is used to create histogram.

--> hist()

[7] How many parameters a hist() function can have?

a) 2

b) 3

c) 4

d) 5
1|Page
Downloaded from www.tutorialaicsip.com
[8] A _______ is a Boolean parameter of hist() function which is by default False.

--> cumulative

[9]A _____ parameter is just a number or series or arrays to be plotted on histogram.

--> x

[10] Which of the following is traditional bar-type histogram?

a) x

b) bins

c) histtype

d) orientation

[11] Which of the following parameter have values like horizontal or vertical?

a) x

b) bins

c) histtype

d) orientation

[12] Which of the following is the correct statement to create a histogram with ndarray x and
bins value 30?

a) hist(x,bins:30)

b) hist(x,bins=30)

[]

c) hist(x,bins-30)

d) hist(x,bins,30)

[13] A ________ value should be specified to histtype to generate a lineplot that is by default
unfilled.

--> step

2|Page
Downloaded from www.tutorialaicsip.com
[14]You cannot create horizontal stacked histogram. (True/False)

[15] Which of the following is correct to generate horizontal stacked histogram?

a) hist([x,y], histtype='barstacked', orientation = 'horizontal')

b) hist([x,y], histtype='horizontal', orientation='barstacked')

c) b) hist([x,y], histtype='horizontal', orientation='landscape')

d) None of these

Histogram for Class 12 IP - Conceptual Descriptive/Subjective Questions

Refer these notes to write answers.

[1] Describe the histogram. How to plot data on histogram?

[2] Explain hist() function in detailed.

[3] Clarify the situations when you need to use bar() charts and when you need to use hist()
chart?

[4]What is the significance of the cumulative histogram? Elaborate your answer with an
example.

[5] How to change the edgecolor and color of histogram bar?

[6] Explain the following parameters of hist() function with example.

1. bins
2. histtype
3. orientation

[7] How to save the histogram as image?

Histogram for Class 12 IP - Application-based questions

[1] Write code to plot following data on histogram:

24,17,14,22,25,26,38,42,24,12,28,19,32,21,35,28,21,31,18,19

import matplotlib.pyplot as mp
l=[24,17,14,22,25,26,38,42,24,12,28,19,32,21,35,28,21,31,18,19]
mp.hist(l)
mp.show()

3|Page
Downloaded from www.tutorialaicsip.com
[2] Generate random numbers from 1 to 70 and plot it on the histogram. Change the
outline color to black and the bar color should be yellow.

import matplotlib.pyplot as m
import numpy as np
x=np.random.randn(70)
m.hist(x,20,edgecolor="black",facecolor="yellow")
m.show()

[3] Display the above data in cumulative mode on histogram.

import matplotlib.pyplot as m
import numpy as np
x=np.random.randn(70)
m.hist(x,20,cumulative= True, edgecolor="black",facecolor="yellow")
m.show()

[4] Write python code to create histogram based on given data:

rcb: 78,63,49,41,68,101,56,79,68,96

mi: 45,85,98,102,42,50,43,48,63,39

import matplotlib.pyplot as m
rcb=[78,63,49,41,68,101,56,79,68,96]
mi=[45,85,98,102,42,50,43,48,63,39]
m.hist([rcb,mi],cumulative='true')
m.show()

[5] Draw histogram for the following code:

import matplotlib.pyplot as m
english=[77,66,88,99,55,44,33,79,68,83]
maths=[56,89,70,50,60,65,90,80,47,82]
m.hist([english,maths], orientation='horizontal')
m.show()

4|Page

You might also like