QP - Info - Gr.12 - June Test - 2021 - Without Options
QP - Info - Gr.12 - June Test - 2021 - Without Options
i
d
Test Instructions:
(i) All questions are compulsory.
(ii) This question paper consists of 15 MCQ questions and 5 descriptive questions.
(iii) MCQs numbered (1-15) carry 2 marks each and Descriptive questions numbered (16-20)
carry 2 marks each.
(iv) Question no. 16 – 20 (scanning and uploading part)
(v) Programming language : Python
import numpy as np
Arr = np.arange(1,11)
print(Arr[10:2:-2])
1
A. line 2 and line 5
B. line 2 and line 3
C. line 4 and line 6
D. line 5 and line 3
2
8 Given the following code and the Output, Fill in the blanks (blank1 & blank2). 2
Countries
India NewDelhi
USA WashingtonDC
UK London
France Paris
dtype: object
4
3
12 Given the following code and the Output, Fill in the blanks (blank1 & blank2). 2
308
0 2
1 2
2 2
3 2
4 2
dtype: int64
Statement 1: Data can be loaded in a DataFrame from a file on the disk by using
Pandas read_csv function.
Statement 2: DataFrame.loc[ ] is used for label based indexing of rows in
DataFrames.
4
15 What would be the outcome of the following statement where DF is a dataframe 2
and v is a list of 3 values ? DF already has columns Eno, Ename, Q2, Q3.
20 Consider the following code of Dataframes df1 and df2 and answer the questions 2
given below:
import pandas as pd
d1={'mark1':[17,18,16,15],
'mark2':[16,15,14,19]}
d2={'mark1':[15,17,16,19],
'mark2':[14,13,17,19]}
df1=pd.DataFrame(d1)
df2=pd.DataFrame(d2)
i) Write the code to add both the DataFrames df1 anf df2 into a new
DataFrame df3.
ii) Write the code to rename the index of df2 from 0,1,2,3 to st1,st2,st3,st4.
*******************************************************************