0% found this document useful (0 votes)
19 views6 pages

Ip MS April Test - 22

The document contains a monthly test for grade 12 students with questions from Section A having multiple choice questions and Section B having descriptive questions. Section A contains 10 multiple choice questions with 1 mark each on topics like NumPy, pandas and arrays. Section B has 4 descriptive questions with marks distribution of 2 marks for each of the first two questions and 3 marks for each of the last two questions involving concepts like NumPy, pandas arrays and series.
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)
19 views6 pages

Ip MS April Test - 22

The document contains a monthly test for grade 12 students with questions from Section A having multiple choice questions and Section B having descriptive questions. Section A contains 10 multiple choice questions with 1 mark each on topics like NumPy, pandas and arrays. Section B has 4 descriptive questions with marks distribution of 2 marks for each of the first two questions and 3 marks for each of the last two questions involving concepts like NumPy, pandas arrays and series.
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/ 6

MONTHLY TEST- APRIL, 2022

Informatics Practices (065)


Grade: 12 Time: 40 minutes
Date: 00.00.2022 Max. Marks: 20
MARKING SCHEME

General Instructions:
(i) All questions are compulsory.
(ii) This question paper has 2 Sections.
(iii) Section A has 10 MCQs numbered (1-10) carry 1 mark each.
(iv) Section B has 4 Descriptive Questions ( Q11 & 12 carry 2 marks each, Q13 &14 carry 3
marks each.
(v) Programming language: Python

SECTION A
1. NumPy is a group of elements of same type and is indexed by _____________. 1m
A. INTEGERS.
B. POSITIVE INTEGER
C. NEGATIVE INTEGER
D. BOTH POSITIVE & NEGATIVE INTEGERS
2. What is the shape of the following array? 1m
Arr1=np.array([ [3,6,2,8],[7,2,9,6] ])
A. (3, )
B. (3, 4)
C. (2, 4)
D. (4, 3)
3. What would be the output of np.zeros((2,3))? 1m
A. array([[0., 0., 0.], [0., 0., 0.]])
B. array([[0, 0, 0], [0, 0, 0]])
C. array([ 0., 0., 0., 0. ])
D. array( [0., 0., 0.], [0., 0., 0.] )
4. np.arange(1,10,2) will create array as___________ . 1m

A. array([1,2,3,4,5,6,7,8,9,10])
B. array([2,4,6,8,10])
C. array([1, 3, 5, 7, 9])
D. array([1, 3, 5, 7, 9, 11 ])
5. What would be the output of the following code? 1m
import numpy as np
a1=np.array([5,7,2,8,9,1])
a2=a1[2:4]
a2[1]=88
print(a1)
A. [5,7,2,8,9,1]
B. [5,7,2,88,9,1]
C. [5,7,2,8,88,1]
D. [5,7,88,8,9,1]

6. Choose the correct option that would display the elements in the 1st and 2nd column of the
given array myarray1. 1m
myarray1=numpy.array([[2.7,-2,-19],[0,3.4,99.9],[10.6,0,13]])

A. print(myarray1[1:3 , 0:2])
B. print(myarray1[ : , 1:2])
C. print(myarray1[0:3 , 1:2])
D. print(myarray1[ : , 0:2])

7. Which of the following 2 line combinations have errors? 1m

Expected output is :
[1 2 3 4 5]
sum= 15

A. line 1 and line 5


B. line 2 and line 3
C. line 4 and line 3
D. line 5 and line 4
8. What would be the output for the following code? 1m
import numpy as np
a=np.array(range(1,8,2))
b=np.array([4,3,2,1])
print(a/b)

A. [0.25 1. 2.5 7. ]
B. [0.25 1 2.5 7 ]
C. [ 1. 2.5 7. 8.5 ]
D. [0.25 1. 2.5 9. ]

9. Which of the following options is correct? 1m

Statement 1: A Series is a two-dimensional labeled data structure like a spreadsheet.


Statement 2: The two common ways of accessing the elements of a series are Indexing
and Slicing.

A. Statement 1 is False & Statement 2 is True


B. Statement 1 is False & Statement 2 is False
C. Statement 1 is True & Statement 2 is True
D. Statement 1 is True & Statement 2 is False

10. Darsh, a student of class-XII has been assigned to create a pandas Series S1 as shown
below: 1m
a 100
b 200
c 300
d 400
e 500
dtype: int64

With reference to the above Series, choose the command that will give the following output:
A. print(S1[:3])
B. print(S1[0:3])
C. print(S1[1:3])
D. print(S1[2:4])

SECTION B
Q11. What would be the output? 2m

Output :

[1. 2. 3. 4.]

[ 4 9 16 25]
Each output line : 1m

Q12. Identify the errors and re-write the code given below: 2m
Identify errors:
import numpy #error1 as np
arr1=np.ones([2,3], datatype=int) #error2 dtype

print(arr1)

arr2=np.zeroes((5, )) #error3 zeros

print("Array 2 = " arr2) #error4 , is missing

re-write code:

import numpy as np
arr1=np.ones([2,3], dtype =int)

print(arr1)
arr2=np. zeros((5, ))

print("Array 2 = " , arr2)

Q13. a) Write the code to create the Series given below: 2m

Each error deduct ¼ m


b) Given the following code and the Output, Fill in the blanks (blank1 & blank2). 1m

Code:
import pandas as _______ # blank1

seriesCapCntry=pd. _________ ( ['NewDelhi ', 'WashingtonDC', 'London', 'Paris'],index=[ 'India',


'USA', 'UK', 'France']) # blank2

print(seriesCapCntry)

Output:
India NewDelhi
USA WashingtonDC
UK London
France Paris
dtype: object
Each blank : ½ m
Q14. a) What will be the output of the following code? 2m
import numpy as np
Arr = np.arange(1,11)
print(Arr[10:2:-2])
print(Arr[2:10:2])

Output :
[10 8 6 4]
[357 9]
Each output line : 1m
b) Differentiate between List and NumpyArray. 1m

1 diff : 1m

You might also like