0% found this document useful (0 votes)
9 views5 pages

XII Informatics Practices (MA3) Answer Key

Ip material
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)
9 views5 pages

XII Informatics Practices (MA3) Answer Key

Ip material
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/ 5

Saraswati International School

MA 3(2021 - 22)

Informatics Practices[065]

Class: XII [Sci & Com] Max. Marks: 10

General Instructions:

1. This question paper contains two case study questions. Each one is compulsory.
2. Each case study has 5 multiple choice questions.

Q.1 Arunati wants to create multiple bar plot horizontally to represent following tabular data.
Happiness_index Happiness_index Happiness_index
City
Men Women Kids
Delhi 60 30 45
Beijing 40 60 50
Washington 70 70 85
Tokyo 65 55 70
Moscow 85 75 80

(i) Complete the following code to create graph,


import matplotlib.pyplot as pt
import numpy as np
hm=[60,40,70,65,85]
hf=[30,60,70,55,75]
hk=[45,50,85,70,80]
City=['Delhi','Beijing','Washington','Tokyo','Moscow']
a.
x=np.arange(len(City))
pt.bar(City,hm,width=0.25)
pt.bar(x+0.25,hf,width=0.25)
pt.bar(x+0.25,hk,width=0.25)

Page. 1
b.
x=np.arange(len(City))
pt.bar(x,hm,width=0.25)
pt.bar(x+0.25,hf,width=0.25)
pt.bar(x+0.5,hk,width=0.25)
c.
x=np.arange(len(City))
pt.barh(City,hm,height=0.2)
pt.barh(x+0.2,hf,height=0.2)
pt.barh(x+0.4,hk,height=0.2)
d.
x=np.arange(len(City))
pt.barh(City,hm,width=0.2)
pt.barh(x+0.2,hf, width =0.2)
pt.barh(x+0.4,hk, width =0.2)

Answer: (c)

(ii) Which option is incorrect to display legend in lower left corner?


a. pt.legend(loc=3)
b. pt.legend(loc='lower left')
c. both a and b
d. pt.legend(loc=2)

Answer: (d)

(iii) Which is correct to display appropriate labels for both axis?


a.
pt.xlabel('Happiness_index')
pt.ylabel('City')
b.
pt.xlabel('City')
pt.ylabel('Happiness_index')
c.
pt.label_x('City')
pt.label_y('Happiness_index')
d.
pt.xlabel='City'
pt.ylabel='Happiness_index'

Answer: (a)

Page. 2
(iv) Which one is incorrect code for displaying appropriate ticks on y-axis?
a.
pt.yticks(x)
b.
pt.yticks(City)
c.
pt.yticks([0,1,2,3,4])
d.
pt.yticks([30,40,50,60,70,80,90])

Answer: (d)

(v) Which one is correct code for displaying appropriate ticks on x-axis?

a.
pt.xticks(x)
b.
pt.xticks(City)
c.
pt.xticks([0,1,2,3,4])
d.
pt.xticks([10,20,30,40,50,60,70,80,90])

Answer: (d)

Q.2 Raghav wants to display the continuous raise in turnover of ABC company in last 5 years
using Histogram.
turn_over=[300,450,530,600,700]
(i) The following code can be used to display cumulative histogram.
a. pt.hist(turn_over,cumulative)
b. pt.hist(turn_over,cumulative=True)
c. pt.hist(cumulative=True)
d. pt.hist(turn_over,True)

Answer: (b)

(ii) Following is incorrect type of histogram.


a. bar
b. stepfilled
c. stacked
d. barstacked

Page. 3
Answer: (c)

(iii) Following code can be used to draw horizontal histogram.


a. pt.histh(turn_over)
b. pt.hist(turn_over, 'horizontal')
c. pt.hist(turn_over)
d. pt.hist(turn_over,orientation='horizontal')

Answer: (d)

(iv) If histogram is created using 5 bins then write code for appropriate x-axis tick marks.
a. pt.xticks([300,380,460,540,620,700])
b. pt.xticks([300,350,400,450,500,550,600,650,700])
c. pt.xticks([300,400,500,600,700])
d. pt.xticks([100,300,500,700,900])

Answer: (a)

(v) Select appropriate code for saving and displaying graph.


a.
pt.save_fig('plot.pdf')
pt.disp()
b.
pt.save('plot.pdf')
pt.display()
c.
pt.savefig('plot.pdf')
pt.show()
d.
pt.save_fig('pot.pdf')
pt.show()

Page. 4
Answer: (c)

Page. 5

You might also like