FAS / INFORMATICS PRACTICES(065) / CLASS XII / TERM 1, PRE BOARD 2/ 2021-22
Time Allowed: 90 minutes Maximum Marks: 35
General Instructions:
The paper is divided into 3 Sections- A, B and C.
• Section A, consists of Question 1 to 25 and student need to attempt 20 questions.
• Section B, consists of Question 26 to 49 and student need to attempt 20 questions.
• Section C, consists of Question 50 to 55 and student need to attempt 5 questions.
• All questions carry equal marks.
Section – A
Section A consists of 25 questions, attempt any 20 questions.
1 Replace the row label ‘Ankit’ with ‘Ankita’ in dataframe ‘DF’
a) DF.Rename({‘Ankit’ : ‘Ankita’})
b) DF.rename({‘Ankit’ : ‘Ankita’})
c) DF.repalce({‘Ankit’:’Ankita’})
d) None of the sbove
2 Which of the following is not valid in terms of a DataFrame?
a) It’s a part pf Pandas
b) We can create 2 dimensional structure
c) User can define index of his choice
d) We cannot change the index once created
3 Choose the equivalent function for A/B operation when applied on two DataFrams A and B
a) A.div(B)
b) B.div(A)
c) Div(A,B)
d) B/A
4 The command used to create an empty Series
a) S=pd.Series()
b) S=pd.Series(np.Nan)
c) S=pd.Series(empty)
d) None of these
5 A series contains a total of 10 elements including a missing value. The output of count and len
functions when applied to this Series respectively will be
(a) 10,10
(b) 9,10
(c) 9,9
(d) 10,9
6 Which of the following is not a valid line style in matplotlib?
(a) ‘-’
(b) ‘--’
(c) ‘-.’
(d) ‘<’
7 D1[ : ] = 77 , will set __________ values of a Data Frame ‘D1’ to 77. Line plot
a) Only first row
b) Only first column
c) All
d) None of the above
8 Which of the following is not a valid plotting function in pyplot?
a) bar()
b) hist()
c) histh()
d) barh()
9 Which of the following functions is used to check the number of rows in a DataFrame?
a) print(length(df))
b) print(length.df)
c) print(len(df))
d) print(length[df])
10 To give a title to x-axis, which of the following method is useful? 1
a) pl.xtitle(“title”)
b) pl.xlabel(“title”)
c) pl.xheader(“title”)
d) pl.xlabel.show(“title”)
11 The is the Digital trail of your activity on the internet.
a) Copyleft
b) Digital footprint
c) Digital data
d) Internet property
12 What is meant by the term cybercrime?
a) Any crime that uses computers to jeopardize or attempt to jeoparadise in national security
b) The use of computer networks to commit financial or identity fraud
c) The theft of Digital information
d) Any crime that involves computers and networks
13 Data which has no restriction of usage and is freely available to everyone under Intellectual Property
Rights is categorized as:
(a) Open source
(b) Open data
a) (c) Open content
b) (d) Open education
14 Which of the following pandas attributes gives output in the form of tuple?
(a) nbytes
(b) ndim
(c) shape
(d) size
15 Which of the following is NOT an intellectual property?
a) A poem written by a poet
b) An original painting made by a painter
c) Trademark of a Company
d) A remixed song
16 An act of stealing others Intellectual Property without their consent of without citing the
sourceis called.
a) Plagiarism
b) Hacking
c) Phishing
d) Bullying
17 While accessing the column from the data frame, we can specify the column name. In case
column does not exist, which type of error it will raise:
a) Key Error
b) Syntax Error
c) Name Error
d) Runtime Error
18 is the attempt to acquire sensitive information such as usernames, passwords and credit card
details by masquerading as a trustworthy entity in an electronic communication.
a) Pharming
b) Phishing
c) Attack
d) Malware
19 To suppress first row as header, which of the following arguments is to be given in read_csv( ) ?
(a) noheader = True
(b) header = None
(c) skipheader = True
(d) header - Null
20 Which of the following is not the correct method of E-waste management?
(a) Regrow
(b) Reduce
(c) Recycle
(d) Reuse
21 A mail or message sent to a large number of people without their consent is called
(a) Cyberstalking
(b) Eavesdropping
(c) Phishing
(d) Spamming
22 Assertion (A): Amit has stolen the content of a research paper and published it online. Amit has
performed cybercrime.
Reason (R): Plagiarism is the act of stealing someone’s work and presenting it as one’s own work.
a) Both (A) and (R) are True, and (R) is the correct explanation of (A).
b) Both (A) and (R) are True, but (R) is not the correct explanation of (A)
c) (A) is true, but (R) is false
d) (A) is false, but (R) is true.
23 CC (in reference to public license) stands for
a) Creative Commons
b) Carbon copy
c) Creative Comments
d) Creative Culture
24 To display the 3rd, 4th and 5th columns from the 6th to 9th rows of a dataframe you can write
(a) DF.loc[6:9, 3:5]
(b) DF.loc[6:10, 3:6]
(c) DF.iloc[6:10, 3:6]
(d) DF.iloc[6:9, 3:5]
25 Which of the following function will create a vertical bar chart ?
(a) plot( )
(b) bar( )
(c) plotbar()
(d) barh( )
Section B
Section B consist of 24 Questions(26-49). Attempt any 20
questions
26
Consider the following
code:
import matplotlib.pyplot as pl
import numpy as np
l1=[2,4,6,7]
l2=[5,7,9,2]
l3=[2,5,9,12]
l=np.array(l3)
l4=[5,8,9,12]
# Line 1
pl.bar(l+0.50,l4,width=0.50,label="australia")
# Line 2
# Line 3
pl.ylabel("goals")
pl.title("chart of score in game")
# Line 4
# Line 5
What will be the line to be written in #Line 1 to plot a bar chart:
a) pl.hbar(l1,l2,width=0.50,label="india")
b) pl.barh(l1,l2,width=0.50,label="india")
c) pl.bar(l1,l2,width=0.50,label="india")
d) pl.plotbar(l1,l2,width=0.50,label="india")
27
Referring to code given in Q26, What will be the line to be written in #Line 2 to set legend:
a) pl.legends(loc="upper left")
b) pl.setlegend(loc="upper left")
c) pl.plotlegend(loc="upper left")
d) pl.legend(loc="upper left")
28 Referring to code given in Q26, What will be the line to be written in #Line 3 to set label on x
axis:
a) pl.xlabels("Time")
b) pl.labelx("Time")
c) pl.xlabel("Time")
d) pl.xaxislabel("Time")
29 Referring to code given in Q26, What will be the line to be written in #Line 4 to show the chart
made:
a) pl.showchart()
b) pl.chartshow()
c) pl.show()
d) pl.fullchartshow()
30 Observe the following figure. Identify the coding for obtaining this as output.
a) import matplotlib.pyplot as plt
eng_marks=[10,55,30,80,50]
st_name=["amit","dinesh","abhishek","piyush
","rita"]plt.plot(st_name,eng_marks)
plt.show()
b) import matplotlib.pyplot as plt
eng_marks=[10,55,30,80,50]
st_name=["amit","dinesh","abhishek","piyush
","rita"]plt.plot(st_name,eng_marks)
c) import matplotlib.pyplot as plt
eng_marks=[10,55,30,80,50]
st_name=["amit","dinesh","abhishek","piyush
","rita"]plt.plot(eng_marks, st_name)
plt.show()
d) import matplotlib.pyplot as plt
eng_marks=[10,55,30,80,50]
st_name=["amit","dinesh","abhishek","piyush
","rita"]
plt.plot(eng_marks, st_name)
31 Read the statements given below and identify the right option to draw a
histogram. Statement A: To make a Histogram with Matplotlib, we can use
the plt.hist() function.Statement B: The bin parameter is compulsory to create
histogram.
a) Statement A is correct
b) Statement B is correct
c) Statement A is correct, but Statement B is incorrect
d) Statement A is incorrect, but Statement B is correct
32 Write a statement to delete the record of ‘Shruti’
a) print(DF.drop(‘Shruti’,axis=0))
b) print(DF.drop(‘Shruti’))
c) both the statements
d) None of the above
33
Referring to code given in Q26, What will be the line to be written in #Line 5 to save the chart
made:
a) pl.savefigure("abc.jpg")
b) pl.savechart("abc.jpg")
c) pl.chartsavefig("abc.jpg")
d) pl.savefig("abc.jpg")
34 Given below there are two statements marked as Assertion (A) and Reason (R) . Read the
statementsand choose the correct option.
Assertion (A): Someone has created a fake social media profile in the name of Saket. Saket is
a victimof cyberstalking.
Reason (R): Cyberstalking is a form of cybercrime.
a) Both (A) and (R) are True, and (R) is the correct explanation of (A).
b) Both (A) and (R) are True, but (R) is not the correct explanation of (A).
c) (A) is true, but (R) is false.
d) (A) is false, but (R) is true.
35 What will be the output of the following
program:import pandas as pd
s=
pd.Series([1,2,3,4,5],index=['a','b','c','d'
,'e'])print(s[::-4])
a) e 5
a 1
dtype: int64
b) a 1
e 5
dtype: int64
c) a 1
d 4
dtype: int64
d) e 5
b 2
dtype: int64
36 Mr. Mathur wants to write Python code to create the following data frame containing marks of 3
students. However, he is facing some problems. Helphim by answering a few questions below.
Code to create the dataframe:
import pandas as pd
df=pd.DataFrame([[21,22,19],[23,22,16],[30,25,26]],\
=['S1','S2','S3'])#statement 1
df. =['M1','M2','M3'] #statement 2
print(df)
Choose the right code for statement 1.
(a) row
(b) column
(c) index
(d) columns
37 Refer to the code given in Q 36, Choose the right code for statement 2.
(a) column
(b) columns
(c) value
(d) values
38 Referring to code given in Q 36, Which of the following commands will output 2 for the
above given DataFrame?
(a) df.size
(b) df.ndim
(c) df.shape
(d) df.index
39 Referring to dataframe given in Q 36, He wants to obtain the sum of marks for each student
as given below. Choose the correct statement to obtain the same.
a) print(df.sum(axis=0))
b) print(df.sum())
c) print(df.sum(0))
d) print(df.sum(1))
40 Write the output of the given
program:import pandas as pd
S1=pd.Series({‘Indore’:20,’Ujjain’:35,’Bhopal’
:40})print(S1[S1>20])
(a) Ujjain 35
Bho
pal 40dtype: int64
(b) Series([], dtype: int64)
(c) Indore 20
Ujjain 35
Bho
pal 40dtype: int64
(d) Ind
ore 20dtype: int64
41 Being a responsible digital citizen, we should
a. not use copyrighted materials
b. avoid cyber bullying
c. respect privacy of others
d. All of the above
42 Consider the pandas Series, S=pd.series([10,20,30,40,50]index=[0,1,2,3,4]), the output of
commandS.iloc[1:3] will include
a) Will produce error
b) Will include values 10,20 30 in result
c) will include values 10,20 in result
d) will include values 20,30 in result
43 Which command will be used to delete 3 and 5 rows of the data frame. Assuming the
data framename as DF.
a) DF.drop([2,4],axis=0)
b) DF.drop([2,4],axis=1)
c) DF.drop([3,5],axis=1)
d) DF.drop([3,5])
44 Write the output of the given
command:import pandas as pd
s=pd.Series([1,2,3,4,5,6],index=['A','B','C','D','E','F'])
print(s[s//2==0])
a) B
2
dty
pe:
int6
4
b) A 1 dtype: int64
c) C 3 dtype: int64
d) E
5
dty
pe:
int6
4
45
A person who starts quarrels or upsets people on the internet to distract and sow discord by
posting inflammatory and digressive, extraneous or off-topic messages to an online community.
This person will be referred as in cyber world.
a. cyber troll
b. cyber stalker
c. Spyware
d. Hacker
46 To suppress first row as header, which of the following arguments is to be given in read_csv( ) ?
(e) noheader = True
(f) header = None
(g) skipheader = True
(h) header - Null
47. A Data Frame is having True and False as its boolean indexes. The command that can be used
to access all the rows corresponding to True boolean index is
(a) print(df.loc(True)
(b) print(df.loc[:,True])
(c) print(df.loc[True])
(d) print(df.loc(True,:)
48 Consi der the following data frame name df
Write the output of the given command:
print(d f.marks/2)
a. 0 45.0
1 NaN
2 43.5
Name: Marks, dtype: float64
b. 0 45.0
1 NaN
2 43
Name: Marks, dtype: float64
c. 0 45
1 NaN
2 43.5
Name: Marks, dtype: float64
d. 0 45.0
1 0
2 43.5
Name: Marks, dtype: float64
49 Consider the below given Data Frame df
The output of the following command will be
print(df[df.C2>10].max()['C1'])
a) 22
b) 10
c) 12
d) 11
Section C
Section C consists of 6 Questions(50-55), Attempts any 5
questions
Mr. Ankit is working in an organisation as data analyst. He uses Python Pandas and Matplotlib
for the same.He got a dataset of the passengers for the year 2010 to 2012 for January, March and
December. His manager wants certain information from him, but he is facing some problems.
Help him by answering few questions given below:
Code to create the above data frame:
import pandas as #Statement 1
data={"Year":[2010,2010,2012,2010,2012],"Month":["Jan","Mar","Jan","Dec","Dec
"],"Passe ngers":[25,50,35,55,65]}
df=pd. (data)
#Statement 2print(df)
50 Choose the right code from the following for statement 1.
a) pd
b) df
c) data
d) p
51 Choose the right code from the following for the statement 2.
a) Dataframe
b) DataFrame
c) Series
d) Dictionary
52 Choose the correct statement/ method for the
required output:(5,3)
a) df.index
b) df.shape()
c) df.shape
d) df.size
53 He wants to print the details of "January" month along with the number of passengers, Identify the
correctstatement:
a) df.loc[['Month','Passengers']][df['Month']=='Jan']
b) df[['Month','Passengers']][df['Month']=='Jan']
c) df.iloc[['Month','Passengers']][df['Month']=='Jan']
d) df(['Month','Passengers']][df['Month']=='Jan')
54 Mr. Ankit wants to change the index of the Data Frame and the output for the same is given below.
Identify
the correct statement to change the index.
a) df.index[]=["Air India","Indigo","Spicejet","Jet","Emirates"]
b) df.index["Air India","Indigo","Spicejet","Jet","Emirates"]
c) df.index=["Air India","Indigo","Spicejet","Jet","Emirates"]
d) df.index()=["Air India","Indigo","Spicejet","Jet","Emirates"]
55 Consider the DataFrame given and write the output of the given command
print(df.loc[:0,'Month'])
a) 0 Jan
b) 1 March
c) 2 Jan
d) 0 Jan
2 Jan