Professional Documents
Culture Documents
IP QP Set-1
IP QP Set-1
IP QP Set-1
Pre-Term-I (2021-22)
Subject: Informatics Practices (Code-065)
SET-A
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 and student need to attempt 20 questions.
Section B, consists of Question number 26 to 49 and student need to attempt 20
questions.
Section C, consists of Question number 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 To create an empty Series object, you can use:
(a) pd.Series(empty) (b) pd.Series( )
(c) pd.Series(np.NaN) (d) all of these
5 Pandas is a:
(a) Library (b) Package
(c) Language (d) None of these
Page 1 of 9
9 DataFrame can be created using …
(a) ndarray (b) Series
(c) DataFrame (d) All of the above
10 To specify the style of line as dashed, which argument of plot( ) needs to be set ?
(a) line (b) width
(c) style (d) linestyle
14 What is the correct syntax to return both the first row and the second row in
Pandas DataFrame df?
(a) df.loc[[0,1]] (b) df[0,1]
(c) df.loc[0,1] (d) df[[0,1]]
16 Which of the following type of digital footprints created by the use intentionally
with their consent?
(a) Active digital footprint (b) Passive digital footprint
(c) Massive digital footprint (d) Interactive digital footprint
19 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) Index Error (b) Column Error
(c) Key Error (d) Runtime Error
20 Following are the impact of e-waste on the environment. Choose the odd one out.
(a) Soil Pollution (b) Water Pollution
(c) Sound Pollution (d) Air Pollution
Page 2 of 9
21 Every activity you perform on the Internet is saved for how long?
(a) One month (b) One year
(c) As per my setting (d) Forever
23 Which argument must be set with plotting functions for legend() to display the
legends ?
(a) data (b) label
(c) name (d) sequence
Section – B
Section B consists of 24 Questions (26 to 49). Attempt any 20 questions.
26 Consider the following series ‘s’, which of the following statement will not be used
to print 30 as output?
s = pd.Series([10,20,30,40,50], index = ['a','b','c','d','e'])
(a) print(s[2]) (b) print(s.iloc[2])
(c) print(s.iat[2]) (d) print(s.loc[2])
27 Which of the following python code will not print following series as output:
a 0
b 1
c 2
(a) import pandas as pd
import numpy as np
s = pd.Series(np.arange(3), list("abc"))
print(s)
(b) import pandas as pd
s = pd.Series(data=*0,1,2+, index=*‘a’,’b’,’c’+)
print(s)
(c) import pandas as pd
s = pd.Series(data=['a','b','c'], index=[0,1,2])
print(s)
(d) import pandas as pd
s = pd.Series(data=[0,1,2], index=list("abc"))
print(s)
Page 3 of 9
28 Identify the incorrect statement.
(a) pd.Series([1,2,3], index=list("abc"))
(b) pd.Series([1,2,3], index=list("123"))
(c) pd.Series(2020, index=range(5))
(d) pd.Series( [11,12,13], index=[1,2,3,4])
30 Observer the figure and fill in the blank with correct statement to plot a bar graph
using a matplotlib method, so that Company DigiNext can see the graphical
presentation of its Profit figures for the 1 st quarter of financial year 2021 (i.e. April,
May, June).
import matplotlib.pyplot as pl
months = ['April', 'May' ,'June']
profits = [5000,6000,5500]
________________________ #fill in the blank
pl.show()
(a) pl.bar(months,profits) (b) plt.bar(profits, months)
(c) bar(months,profits) (d) pl.bar(profits, months)
32 Which graph should be used where each column represents a range of values, and
the height of a column corresponds to how many values are in that range?
(a) plot (b) histogram
(c) line (d) bar
Page 4 of 9
33 Which one of the following is not an example of Free and Open Source Software.
(a) Python (b) Mozilla Firefox
(c) Ms-Office (d) Ubuntu
35 Find the correct output after execution of the following Python code:
import pandas as pd
df = pd.DataFrame({"A":["P1","P2","P3"],
"B":["Pencil","Pen","Marker"],
"C":[40,45,55]
})
df = df.rename(columns={"A":"Code","B":"Item","C":"Rate"})
df = df.rename(index={0:'P',1:'E', 2:'M'})
print(df)
(a) A B C (b) A B C
0 P1 Pencil 40 P P1 Pencil 40
1 P2 Pen 45 E P2 Pen 45
2 P3 Marker 55 M P3 Marker 55
(c) Code Item Rate (d) Code Item Rate
0 P1 Pencil 40 P P1 Pencil 40
1 P2 Pen 45 E P2 Pen 45
2 P3 Marker 55 M P3 Marker 55
36 What should your response be if you receive an email stating that you have won a
lottery or received some inheritance from an unknown person?
(a) Send them email asking for further procedure
(b) Ignore it
(c) Mark it as spam and block it
(d) Install antivirus
Page 5 of 9
39 Which of the following statement will not be used to print 3 as output?
import pandas as pd
df = pd.DataFrame({"A":[1,4],
"B":[2,5],
"C":[3,6]
})
(a) print(df.loc[0]['C']) (b) print(df.loc[0,'C'])
(c) print(df.at[0,'C']) (d) print(df.at[0]['C'])
Page 6 of 9
2 m
3 p
4 i
5 n
6 f
7 o
dtype: object
42 Which command will be used to delete both the rows 3 and 5 rows of the data
frame. Assuming the dataframe name as df.
(a) df=df.drop([2,4]) (b) df=df.drop((2,4))
(c) df=df.drop((2,4), axis=1) (d) df=df.drop((3,5), axis=0)
44 We should exhibit proper manners and etiquettes while being online. Choose the
right net etiquette(s) from the following
(a) Avoid cyber bullying (b) Respect other’s privacy
(c) No copyright violation (d) All of the above
45 ____________is the practice of taking someone else's work or ideas and passing
them off as one's own.
(a) Plagiarism (b) Copyright
(c) Patent (d) All of the above
47 Consider the following series ‘s’, write the output of the given command:
0 1
1 2
2 3
dtype: int64
print(s + s[::-1])
(a) 0 4 (b) 0 1
1 4 1 2
2 4 2 3
dtype: int64 dtype: int64
(c) 0 2 (d) Error
1 4
Page 7 of 9
2 6
dtype: int64
49 Read the statements given below. Identify the right option from the following for
Pandas.
Statement A: A Pandas series object can be thought of as a column or a row.
Statement B: Both series and dataframe are one-dimensional data structure
objects.
(a) Both statements are correct.
(b) Both statements are incorrect.
(c) Statement A is correct, but Statement B is incorrect
(d) Statement A is incorrect, but Statement B is correct
Section - C
Section C, consists of 6 Question (50 to 55). Attempt any 5 questions.
Case Study
Miss Priya is working with an IT company and she has provided some data. On which she
wants to do some operations, but she is facing some problem, help her:
Code:
import pandas as pd
emp_data = {'name':['Naveen','Rehan','Johny', 'Rosy', 'Mandip'],
'id':[1001,1002,1003,1004,1005],
'department':['IT','IT','Sales','Accounts','Purchase'],
'salary':[90000,92000,80000,75000,70000]}
df = pd.DataFrame(emp_data)
print(df)
Page 8 of 9
Output of the above code:
51 She wants to set all the values to zero in data frame, choose the right command to
do so:
(a) df = 0 (b) df [] = 0
(c) df.empty = 0 (d) df [ : ] = 0
52 She wants to delete a column ‘Bonus’, which of the following command does not
do it.
(a) df.drop('Bonus', axis=1, inplace=True)
(b) df.drop('Bonus', axis=0, inplace=True)
(c) del df['Bonus']
(d) df.pop('Bonus')
53 The following code is to create another data frame, which she wants to add to the
existing Data frame. Choose the right command to do so:
new_df = pd.DataFrame({'name':['Tina'], 'id':[5678],
'department':['EDP'],'salary':[56000]})
print(new_df)
(a) df.append(new_df) (b) df.append(new_df, axis=0)
(c) df.insert(new_df) (d) None of the above
54 She wants to display the salary of ‘Rehan’, choose the right command to do so:
(a) df.iloc[1][-1] (b) df.iloc[1,-1]
(c) df.loc[1][-1] (d) All of the above
print(df.size)
(a) 5 (b) 4
(c) (5,4) (d) 20
Page 9 of 9