You are on page 1of 11

Toc H Public School, Vyttila, Kochi – 682019

Third Periodic Test - October 2021


Subject: Informatics Practices (Code-065)
Class – XII
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, Attempt 20 questions.
• Section B, consists of Question number 26 to 49.Attempt 20 questions.
• Section C, consists of Question number 50 to 55 .Attempt 5 questions.
• All questions carry equal marks.

SECTION – A
Section A consists of 25 questions, attempt any 20 questions.

1. Which of the following module is to be imported to create Series?


a. NumPy
b. Pandas
c. Matplotlib
d. None of the above

2. 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

3. Which of the following libraries allow to manipulate, transform and


visualize data easily and efficiently?
a. Pandas
b. NumPy
c. Matplotlib
d. All of the above

4. Out of the following, which function cannot be used for customization


of charts in Python?
a. xlabel()
b. colour()
c. title()
d. xticks()

5. In Pandas the function used to delete a column in a DataFrame is :


a. remove
b. del
c. drop
d. cancel

6. Which of the following statement is wrong?


a. We can create Series from Dictionary in Python.
b. Keys of dictionary become index of the series.
c. Order of indexes created from Keys may not be in the same order as
typed in dictionary.
d. All are correct
Std.12. Pg 1 of 11
7. In a dataframe, axis=0 represents:
a. row
b. column
c. rows and columns
d. None of the above

8. A Series by default have numeric data labels starting from __________.


a. 3
b. 2
c. 1
d. 0

9. What is the correct syntax to return both the first row and the second
row in a Pandas DataFrame df?
a. df.loc[[0,1]]
b. df.[[0,1]]
c. df.loc[[0-1]]
d. df.[[0-1]]

10. Select the correct option to complete the Python program:

import pandas as _____


series1 = ps.Series([40,50,60])

a. plt
b. ps
c. pd
d. pt

11. Which of the following statement sort Series S1 in descending order ?


a. S1.sort_values()
b. S1.sort_values(ascending=False)
c. S1.sort_values(ascending=True)
d. S1.sort()

12. Which of the following statement will print Series ‘S1’ in reverse order?
a. print(S1[: : 1])
b. print(S1[: : -1])
c. print(S1[-1: : 1])
d. print(S1.reverse( ))

13. A dataframe in Python Pandas can be created using ___________


a. A Python dictionary
b. A scalar value
c. A List
d. All of these

14. The function to create a dataframe from a CSV file is _____________


a. to_csv()
b. load_csv()
c. fetch_csv
d. read_csv()

Std.12. Pg 2 of 11
15. Using Python Matplotlib ___________ can be used to count how many
values fall into each interval.
a. line plot
b. bar graph
c. histogram
d. None of the above

16. Online posting of rumors, giving threats online, posting the victim’s
personal information, comments aimed to publicly ridicule a victim is
termed as __________
a. Cyber bullying
b. Cyber crime
c. Cyber insult
d. All of the above

17. Unsolicited commercial email is known as_____________


a. Spam
b. malware
c. Virus
d. Spyware

18. A software that can be freely accessed and modified is called _______
a. Synchronous software
b. Package Software
c. Open source software
d. Middleware

19. Which of the following is not a violation of IPR?


a. Plagiarism
b. Copyright
c. Patent
d. Trademark

20. 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

21 Online personal accounts like Paytm account, Phone pe account etc.


are examples of:
a. Digital property
b. Digital Wallets
c. Digital Certificates
d. Digital Signature

22. Which of the following command will display the column labels of the
DataFrame?
a. print(emp.column)
b. print(emp.‘column’)
c. print(emp.columns())
d. print(emp.columns)

Std.12. Pg 3 of 11
23. CEO needs to know the salary of the employee with accno 1421. Help
him to identify the correct set of statement/s from the given options:

a. emp1=emp[[‘accno’]==1421]
b. emp1=emp[accno]=1421
c. emp1=emp[emp.accno=1421]
d. emp1=emp[emp.accno==1421]

24. 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

25. Method or function to add a new row in a data frame is:


a. loc()
b. iloc()
c. join
d. add()

SECTION – B
Section B consists of 24 Questions (26 to 49). Attempt any 20 qns.

26. Select the output of the following code:


S1=pd.Series(14, 7, index = ['a', 'b', 'c'])
print(S1)
a.
a 14
b 7
c 7
dtype: int64

b.
a 14
b 7
dtype: int64

c. Error
d. None of the above

27.Consider Series S2, which command will print 5 as output?


Ravi 90
Rohan 100
Janki 50
Pradeep 67
Abdul 89

a. S2.index
b. S2.length
c. S2.values
d. S2.size

Std.12. Pg 4 of 11
28. What will be the output for the following code:
import pandas as pd
fst=[9,10,11]
ser1=pd.Series(data=fst*2)
print(ser1)

a. 0 9
1 10
2 11
3 9
4 10
5 11

b. 0 18
1 20
2 22

c. Error

d. None of these

29. Anushka is using her internet connection to book a train ticket. This
is a classic example of leaving a trail of web activities carried by her.
What do we call this type of activity?

a. Digital login
b. Digital Footprint
c. Digital Log off
d. Digital Error

30. Consider the following graph. Write the code to plot it.

a.import matplotlib.pyplot as plt


a = [1,2,3,4,5]
b = [10,31,16,14,20]
plt.plot(a,b)
plt.show()

b.import matplotlib.pyplot as plt


plt.plot([1,2,3,4,5],[12,40,10,12,15])
plt.show()

Std.12. Pg 5 of 11
c.import matplotlib.pyplot as plt
a = [1,2,3,4,5]
b = [10,31,26,24,20]
plt.plot(b,a)
plt.show()

d.import matplotlib.pyplot as plt


plt.plot([12,40,10,12,15], ([0,1,2,3,4,5])
plt.show()

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()
Statement B: The bin parameter is compulsory to create histogram.
a. Statements A and B are correct
b. Statements A and B are incorrect
c. Statement A is correct, but Statement B is incorrect
d. Statement A is incorrect, but Statement B is correct

32. Which of the following function will create a vertical bar chart ?
a. plot( )
b. bar( )
c. plotbar()
d. barh( )

33. Which of the following practices ensure confidentiality of information?


Statement 1: Use of firewall wherever possible
Statement 2: Do not email confidential data
a. Both Statements 1 and 2
b. Statement 1 but not Statement 2
c. Neither Statement 1 nor 2
d. Statement 2 but not Statement 1

34. Which of the following statement will modify the first three values of
Series ‘S1’?
a. S1[0, 1, 2] = 100
b. S1[0 : 3] = 100
c. S1[ : 3] = 100
d. All of the above

35. What is the correct output for following Python code:


import pandas as pd
data = {"Marks1": 90, "Marks2": 95, "Marks3": 97}
ser = pd.Series(data)
print(ser)

a.
90 Marks1
95 Marks2
97 Marks3

Std.12. Pg 6 of 11
b. Marks1 90
Marks2 95
Marks3 97

c. Marks1 Marks2 Marks3


90 95 97

d. None of the above

36. Identify the correct difference between loc() and iloc().:


a. Both are Label indexed based functions.
b. Both are Integer position-based functions.
c. loc() is label based function and iloc() integer position based function.
d. loc() is integer position based function and iloc() index position based
function

37. Write correct Python statement to display 2nd and 3rd rows and 6th and
7th columns from a DataFrame Sales.
a. Sales.iloc[1:3,5:7]
b. Sales.loc[2:4,6:7]
c. Sales.iloc[2:4,6:7]
d. None of the above

38. The following code creates a dataframe named ‘D1’ with ______ rows.
import pandas as pd
L = [{'a':10, 'b':20}, {'a':5, 'b':10, 'c':20}]
D1 = pd.DataFrame(L)

a. 0
b. 1
c. 2
d. 3

39. Which of the following is a/an open-source software?


a. Microsoft Windows
b. Adobe Photoshop
c. Mysql
d. MS PowerPoint

40. 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"]
b. df.index["Air India","Indigo","Spicejet"]
c. df.index=["Air India","Indigo","Spicejet"]
d. df.index()=["Air India","Indigo","Spicejet"]

Std.12. Pg 7 of 11
41. 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 above

42. To select rows where 50 and above marks are scored in English subject
a. df[df[‘English’]>50]
b. df[df[‘English’]>=50]
c. df[df[‘English’]=>50]
d. df[df[‘English’]==50]

43. Write the output of the given program:


import pandas as pd
S1=pd.Series([5,6,7,8,10],index=['v','w','x','y','z'])
l=[2,6,1,4,6]
S2=pd.Series(l,index=['z','y','a','w','v'])
print(S1-S2)

a.
a 0
v -1.0
w 2.0
x NaN
y 2.0
z 8.0
b.
a NaN
v -1.0
w 2.0
x NaN
y 2.0
z 8.0
c.
v -1.0
w 2.0
y 2.0
z 8.0

d.
a NaN
v -1.0
w 2.0
x 3.0
y 2.0
z 8.0

44. Disposing of gadgets and devices properly is called _____________


a. Cyber Forensic
b. E-waste management
c. Modernization
d. none

Std.12. Pg 8 of 11
45. Which argument is used to change the width of line in line graph?

a. markersize
b. linestyle
c. linewidth
d. width

46. Which of the following statements is used to create a histogram of 'step'


type with 20 bins?

a. plt.hist(x, bins = 20, histtype = "barstacked")


b. plt.hist(x, bins = 20)
c. plt.hist(x, bins = 20, histtype = "step")
d. plt.hist(x, bins = 20, histtype = hist())

47. Select a command to add a column ‘eligible’ with value ‘yes’ .

a. df(‘eligible’) = ‘yes’
b. df[‘eligible’] == ‘yes’
c. df[‘eligible’] = ‘yes’
d. None of the above

48. Consider two dataframes df1 and df2, select the correct statement to
combine these two dataframes.

a. df_result = pd.concat([df1, df2])


b. df_result = df1.concate(df2)
c. df_result = pd.concat(df1, df2)
d. df_result = [df1].concat([df2])

49. Consider the dataframe df_marks given below:

NAME PHYSICS CHEMISTRY ALGEBRA


0 SAM 68 84 78
1 KEREN 74 56 88
2 AMAL 77 73 82
3 LINI 78 69 87

Choose the command to add 4th row (given below) into df_marks.
new_row = {'name':'Geo', 'physics':87, 'chemistry':92, 'algebra':97}

a. df_marks = df_marks.insert(new_row, ignore_index=True)


b. df_marks = df_marks.append(new_row, ignore_index=True)
c. df_marks = df_marks.concat(new_row, ignore_index=True)
d. df_marks = df_marks.add(new_row, ignore_index=True)

Std.12. Pg 9 of 11
SECTION - C
Section C, consists of 6 Question (50 to 55). Attempt any 5 qns.
CASE STUDY

Mr. Pradeep is working as IT professional. He has provided some data to


develop an application for managing students data. Using which he
created a dataframe(df) which is given below. He wants to do some
operations on that data. Help him to complete the tasks:

Based on the given information, answer the questions No. 50-55

50. He wants to select all the rows from the given dataframe in which
‘Percentage’ is greater than 80 .
a. rslt_df = df[df['Percentage'] > 80]
b. rslt_df = df['Percentage'> 80]
c. rslt_df = df[df[Percentage] > 80]
d. rslt_df = df[df(['Percentage'] > 80)]

51.Help him to select Name and Percentage of 2nd and 3rd student .
a. print(df.iloc[1:3, ['Name', 'Percentage']])
b. print(df.loc[0:2, 'Name', 'Percentage'])
c. print(df.iloc[0:2, ['Name', 'Percentage']])
d. print(df.loc[1:3, ['Name', 'Percentage']])

52. He wants to add a new column ‘Regno’ as the first column with values
[1201,1202, 1203,1204,1205,1206]
a. df.insert(1, "Regno", [1201,1202,1203,1204,1205,1206])
b. df.insert(0, Regno, [1201,1202,1203,1204,1205,1206])
c. df.insert(0, "Regno", [1201,1202,1203,1204,1205,1206])
d. df.append(0, "Regno", [1201,1202,1203,1204,1205,1206])

53. He has to prepare a report in the ascending order of Percentage.


a. a= df.sort_values(by =Percentage, ascending = True)
b. a= df.sort_values(by ='Percentage', ascending = True)
c. a= df.sort_value('Percentage', ascending = True)
d. a= df.sort('Percentage', ascending = True)

54.Help him to remove columns ‘AGE’ and ‘STREAM’ .


a. df.drop(['AGE', 'STREAM'], axis=1)
b. df.drop(['AGE', 'STREAM'], axis=0)
c. df.drop('AGE', 'STREAM', axis=0)
d. df.drop([AGE, STREAM], axis=1)
Std.12. Pg 10 of 11
55.What will be the output of df.shape if the final dataframe is as given
below:

a. (4, 4)
b. (5, 4)
c. (4, 5)
d. (5, 5)

Std.12. Pg 11 of 11

You might also like