Professional Documents
Culture Documents
QP - Info - Gr.12 - June Test - 2021 - MS
QP - Info - Gr.12 - June Test - 2021 - MS
QP - Info - Gr.12 - June Test - 2021 - MS
Subject(065)
Grade : 12 MARKING SCHEME Time: 1 ½ Hours
Date: 3/6/2021 Max. Marks : 40
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])
Output 1 Output 2
[ 10 8 6 4 2] [ 4 6 8 10]
Output 3 Output 4
[10 8 6 4] [2 4 6 8 10]
A. Output 2
B. Output 3
C. Output 4
D. Output 1
1
3 What would be the output? 2
Output 1 Output 2
Output 3 Output 4
[1 2 3 4] [ 4 9 16 25]
[ 4 9 16 25] [1 2 3 4 ]
A. Output 1
B. Output 3
C. Output 4
D. Output 2
2
A. np.median(x)
B. np.median()
C. x.median()
D. numpy.median(x)
Output 1 Output 2
8 42 0 10
9 48 1 15
dtype: int32 2 18
0 10 3 22
1 15 4 55
2 18 dtype: int32
3 22 8 48
4 55 9 97
dtype: int32 dtype: int32
Output 3 Output 4
0 10 1 18
1 18 2 22
2 22 3 88
3 88 4 77
4 77 5 40
dtype: int32 dtype: int32
8 98 8 98
9 20 9 20
dtype: int32 dtype: int32
A. Output 1
B. Output 4
C. Output 3
D. Output 2
3
7 Which of the following 2 line combinations have errors? 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
4
10 Which of the following options is correct? 2
Output 1 Output 2
Output 3 Output 4
A. Output 4
B. Output 1
C. Output 2
D. Output 3
12 Given the following code and the Output, Fill in the blanks (blank1 & blank2). 2
5
and the output :
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.
6
Output 1 Output 2
A. Output 3
B. Output 2
C. Output 1
D. Output 4
Ans:
import pandas as pd
sales=pd.Series([2000,1000,3000,5000],
index=['Q1','Q2','Q3','Q4'])
sales.name="Sales"
print(sales)
7
Ans:
Ans:
import pandas as pd
data = {"Year": [2010,2010,2012,2012],
"Month": ["Jan","Mar","Jan","Dec"],
"Passengers": [25,50,35,65]}
df=pd.DataFrame(data, index = ["Air India",
"Indigo","Spicejet","emirates"])
print(df)
Each error deduct ½ mark
Total : 2 marks
Ans:
3 Grapes
1150.0
Each output 1 mark
Total 2 marks
20 Consider the following code of Dataframes df1 and df2 and answer the questions 2
given below:
8
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.
Ans:
i) # to add both dataframes into df3
df3=df1.append(df2)
*******************************************************************