Professional Documents
Culture Documents
GRADE-XII
INFORMATICS PRACTICES(065) SET-B
CUMULATIVE EXAMINATION-I
DURATION: 3 HRS MAX.MARKS:70
PART-A (15X1=15)
1 _________method in Pandas can be used to change the index of rows and columns of a Series or
Dataframe :
(i) rename()
(ii) reindex()
(iii) reframe()
(iv) none of the above
2 CSV stands for _____________.
3 Which of the following statement will import pandas?
(i) import panda as pd (ii) import pandas as py
(iii) import from panda as pd (iv) All of the above
4 Missing data in pandas series and dataframe s can be filled with a ___________ value.
5 Which of the following is not a valid plotting function of Pyplot?
a. bar( ) b. hist( ) c. histh( ) d. barh( )
6 A _____________ is a summarization tool for discrete or continuous data.
7 __________ is a versatile command and takes an arbitrary number of arguments.
8 Which of the following command will display the number of elements in the DataFrame?
a. print(df.shape)
b. print(df.num)
c. print(df.size)
d. print(df.elements)
9 ___________ is a type of chart which displays information as a data points.
10 Which among the following option will give 90 95 as output
a. print(max(df['Score1','Score2'])
b. print(max(df['Score1']), max(df['Score2']))
c. print(max(df['Score1'])
d. print(max(df['Score2'])
11 If data is an ndarray, ________ must be of same length as data.
12 Which command is used to import matplotlib?
13 ___________ function is used to export a CSV file to dataframe format.
14 The __________ can be plotted vertically or horizontally.
15 What is the use of tail( ) function?
PART-B (8X2=16)
1
Write python statements to create a data frame for the following
data.
Name Age Designation
RAJIV 20 CLERK
SAMEER 35 MANAGER
KAPIL 45 ACCOUNTANT
2 What are differences between reindex() and rename()?
3 What all libraries do you require in order to bring data from a CSV file into a dataframe?
4 Write the name of methods used in pyplot ?.
5 Consider the given python code:
import pandas as pd
lst=[10,20,30,40]
sr=pd.Series(lst)
print(lst*2) #first print
print(sr*2) #second print
i. Does first print and second print produce the same output?
ii. Justify your answer
iii. Write output of the code
6 What will be the output of the following program:
import pandas as pd
a = pd.Series([1,2,3,4,5], index=['A','B','C','D','E'])
print(a -1)
print( a>=3)
a['A'] = 'Z'
print(a)
7 Define the following terms
(1)loc[].
(2).iloc[].
8 What is data visualization?
PART-C (8X3=24)
1 Find the output of following program.
import numpy as np
d=np.array([10,20,30,40,50,60,70])
print(d[-4:])
2 Mention 2 data structures of pandas. Also mention the method used to create these data structures.
3 What all libraries do you require in order to bring data from a CSV file into a dataframe?
4 Q.14) Mr. Kamlesh wants to plot a Bar Graph for the given set of values of months on x-axis
and number of participants who attended workshop in particular month on y-axis.
Sample DataFrame:
exam_data = {'name': ['Anastasia', 'Dima', 'Katherine', 'James', 'Emily',
'Michael', 'Matthew', 'Laura', 'Kevin', 'Jonas'], 'score': [12.5, 9, 16.5, np.nan, 9, 20, 14.5,
np.nan, 8, 19],
'attempts': [1, 3, 2, 3, 2, 3, 1, 1, 2, 1],
'qualify': ['yes', 'no', 'yes', 'no', 'no', 'yes', 'yes', 'no', 'no', 'yes']}
labels = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j']
2 Q.3)Create multiple line chart.s on common plot where 4 data ranges are
plotted on same chart. The data ranges to be plotted are:
Data=[ [5., 15., 25., 35.], [9., 18., 21., 15.,], [2., 18., 10., 30.], [13., 27., 20.,35.] ]