Ip Questions
Ip Questions
Sharma, a game developer, has plotted a chart to estimate the distribution of two different ratings
of the various games available in the Play Store, as shown below:
He is trying to write the following statements to plot the graph. Help Mr. Sharma to fill up the blanks
with Python code to get the desired output.
import pandas as pd
_________________ # statement 1
df =______({'Games':['Subway','Surfer','Temple Run','Candy Crush','Bottle Shot','Runner Best'],
'Rating1':[15,5,6,18,20,15], 'Rating2':[25,10,28,45,32,30] } ) # statement 2
______(kind = 'bar', x = 'Games', y =_______) # statement 3 & 4
mat.xlabel('Games')
mat.ylabel('Rating')
mat.title ('Ratings of Games')
mat.show()
i. Choose the correct Python statement to import the library to plot the bar graph in statement 1.
ii. Choose the correct Python statement to create the dataframe in statement 2.
iii. Choose the correct Python statements in statements 3 and 4, respectively, to plot a bar graph from
the dataframe created.
2) You are provided with the following data on the number of students who participated in a programming
competition over the years:
Create a bar graph to visualize the growth of participants over the years. Give appropriate labels and also
save the figure obtained.
3) Consider the given DataFrames “Stock‟
Write suitable Python statements for the following:
Code
E1 Sanya
E2 Krish
E3 Rishav
E4 Deepak
6) Write a program to create a series object using a dictionary that stores the number of students
in each house of class 12 of your school. Note : Assume the four house names are Beas,
Chenab, Ravi, Sutlej having 18, 2, 20, 18 students respectively and Pandas has been imported
as pd.
7) What will be produced by the following python code? [Assuming that all necessary libraries and
modules are imported ]
series1 = pd.Series(np.array([31,28,31,30]), index = ["Jan", "Feb", "Mar",”Apr”])
print(series1)
8) What will be the output of the following code:
import pandas pd
A=pd.Series(data=[35,45,55,40])
print(A>45)
9) Write SQL commands for the following queries based on the relation teacher given below:
20) Write python code to draw the following bar graph representing number of students in each
class.
CLASS STRENGTH
XII
XI
DIVISION
IX
0 10 20 30 40 50 60
NUMBER OF STUDENTS