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

QP - Info - Gr.12 - June Test - 2021 - Without Options

The document contains a term test for grade 12 with 20 questions covering topics related to Python and Pandas. The test has 15 multiple choice questions worth 2 marks each and 5 descriptive questions worth 2 marks each. The questions cover concepts like NumPy, Pandas Series and DataFrames, data loading and manipulation.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views6 pages

QP - Info - Gr.12 - June Test - 2021 - Without Options

The document contains a term test for grade 12 with 20 questions covering topics related to Python and Pandas. The test has 15 multiple choice questions worth 2 marks each and 5 descriptive questions worth 2 marks each. The questions cover concepts like NumPy, Pandas Series and DataFrames, data loading and manipulation.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

M

i
d

Term Test – June 2021


Subject(065)
Grade : 12 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

QNo QUESTIONS MARK


1 What is the full form of NumPy? 2

2 What will be the output of the following code? 2

import numpy as np
Arr = np.arange(1,11)
print(Arr[10:2:-2])

3 What would be the output? 2

4 Which of the following 2 line combinations have errors? 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

5 Which of the following options can complete line 6? 2

6 What would be the output? 2

7 Which of the following 2 line combinations have errors? 2

A. line 2 and line 6


B. line 5 and line 4
C. line 2 and line 5
D. line 4 and line 6

2
8 Given the following code and the Output, Fill in the blanks (blank1 & blank2). 2

and the output :

Countries
India NewDelhi
USA WashingtonDC
UK London
France Paris
dtype: object
4

9 Which line combinations have error? 2

A. line 3 and line 6


B. line 1 and line 4
C. line 2 and line 5
D. line 2 and line 4

10 Which of the following options is correct? 2

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

11 What will be the output of the following code? 2

3
12 Given the following code and the Output, Fill in the blanks (blank1 & blank2). 2

and the output :

308
0 2
1 2
2 2
3 2
4 2
dtype: int64

13 Which of the following options is correct? 2

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.

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

14 What would be the output? 2

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.

DF.insert(loc=2, column= ' Q1 ', value=v)

A. add a column called Q1 after column Eno.


B. add a column called Q1 before column Q2.
C. insert a column called Q1 after column Q2.
D. insert a column called Q1 before column Q3.

16 Write the code to create the Series given below: 2

17 What would be the output? 2

18 Write the code to create the DataFrame given below: 2

19 What would be the output of the following code? 2


import pandas as pd
d={'Prod':['Apple','Pear','Banana','Grapes'],
'Qty':[100,150,200,250],
5
'Cost':[1000,1500,1200,900] }
df=pd.DataFrame(d)
print(df['Prod'][df['Qty']>200])
print(df['Cost'].mean())

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.

*******************************************************************

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy