IP QP Set-1

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 9

Kendriya Vidyalaya Sangathan, Bhopal Region

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

2 CSV stands for:


(a) Comma Separated Variables (b) Comma Separated Values
(c) Column Separated Values (d) Column Separated Values

3 The command to install the pandas is


(a) install pip pandas (b) install pandas
(c) pip install pandas (d) pip pandas

4 Missing data in pandas is represented through:


(a) Null (b) None
(c) NaN (d) Missing

5 Pandas is a:
(a) Library (b) Package
(c) Language (d) None of these

6 In a dataframe’s drop function, axis=0 may be written as


(a) axis=’index’ (b) axis=’row’
(c) axis=’columns’ (d) None of these

7 The function used to display the label for x-axis to a graph is ……


(a) xtitle() (b) xaxis()
(c) setxlabel() (d) xlabel()

8 To get number of elements in a DataFrame, ___________ attribute may be used.


(a) shape (b) size
(c) values (d) ndim

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

11 _____________ is the function to save the graph.


(a) savefig() (b) savefigure()
(c) savegraph() (d) savechart()

12 Which of the following is not a violation of IPR?


(a) Trademark Infringement (b) Copyright Infringement
(c) Plagiarism (d) Patent

13 Which of the following is not a Cyber Crime:


(a) hacking (b) phishing
(c) spamming (d) None of these

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]]

15 The rights of the owner of information to decide how much information is to be


shared/ exchanged/ distributed, are collectively known as ___________
(a) Intelligent Property Rights (b) Intellectual Property Rights
(c) Interactive Property Rights (d) Instance Property Rights

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

17 Statement that displays first 5 rows of a DataFrame df:


(a) df[:5] (b) df.head()
(c) df.iloc[:5] (d) All of these

18 Which of the following is not an attribute of pandas DataFrame?


(a) index (b) empty
(c) column (d) axes

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

22 The legal and regulatory aspects of the internet refer to.....................


(a) Cyber Space (b) Cyber crime
(c) Criminal law (d) IT act

23 Which argument must be set with plotting functions for legend() to display the
legends ?
(a) data (b) label
(c) name (d) sequence

24 A CSV file can take __________ character as separator.


(a) , (b) ~
(c) | (d) All of these

25 If a Dataframe is created using a 2D dictionary, then the indexes/row labels are


formed from
(a) dictionary's values (b) inner dictionary's keys
(c) outer dictionary's keys (d) None of these

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])

29 Executing IPR: say for a software


(a) Code of the software will be protected by a copyright
(b) Functional expression of the idea will be protected by a patent
(c) The name and logo of the software will come under a registered trademark
(d) All of the above

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)

31 Read the statements given below. Identify the right option.


Statement A: Pandas offer a single and convenient place to plot graphs i.e.
matplotlib for visualization and data analysis through graphs.
Statement B: Matplotlib is a 2-D plotting library that helps in visualizing figures.
(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

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

34 Consider the following statements with reference to the use of email:


Statement 1: Sending threatening messages to a classmate.
Statement 2: Inviting friends to participate in a school club or sports activity.
Statement 3: Asking your teacher for help on homework.
Statement 4: Responding to or forwarding spam emails.
Which of the above statements refer to appropriate use of email?
(a) Statements 1 and 2. (b) Statements 2 and 4.
(c) Statements 3 and 4. (d) Statements 2 and 3.

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

37 Which of the following is not a way to import a module ‘pandas’:


(a) import pandas (b) import pandas as pd
(c) from pandas import * (d) from pandas as pd

38 Feasible method(s) to manage e-waste:


(a) Reduce (b) Recycle
(c) Reuse (d) All of the above

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'])

40 Find the output of following code:


import pandas as pd
df = pd.DataFrame([1],[2],[3])
print(df)
(a) 0 1 2 (b) 3
0 1 2 3 2 1
(c) 0 (d) 0 1
0 1 1 2
1 2 2 3
2 3

41 Write the output of the given program:


import pandas as pd
s1 = pd.Series(['c','o','m','p'], index=list("dcom"))
s2 = pd.Series(['i','n','f','o'], index=list("comp"))
print(s1)
print(s2)
print(s1+s2)
(a) d c
c o
o m
m p
c i
o n
m f
p o
dtype: object
(b) c o
c i
d c
m p
m f
o m
o n
p o
dtype: object
(c) c oi
d NaN
m pf
o mn
p NaN
dtype: object
(d) 0 c
1 o

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)

43 Find the output of the given command:


import pandas as pd
s = pd.Series([78,50,94,60], index=['Amit','Kavita','Dinesh','Ramesh'] )
print(s[s>60])
(a) Amit 78 (b) Amit
Dinesh 94 Dinesh
dtype: int64 dtype: int64
(c) Amit 78 (d) Kavita 50
Dinesh 94 dtype: int64
Ramesh 60
dtype: int64

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

46 To display a tuple representing the dimensionality of the DataFrame Df.


(a) Df.shape() (b) Df.shape
(c) Df.size() (d) Df.size

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

48 Consider the following dataframe name df


one two
0 12 45.0
1 34 NaN
2 56 30.0

Write the output of the given command:


print(df.two/2)
(a) 0 22.5
1 NaN
2 15.0
Name: two, dtype: float64
(b) 0 22.5
1 0.0
2 15.0
Name: two, dtype: float64
(c) 0 22.5
1 0
2 15
Name: two, dtype: float64
(d) 0 22.5
1 0.0
2 15
Name: two, dtype: float64

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:

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


50 She wants to add a new column ‘Bonus’ in above dataframe, choose the right
command to do so:
(a) df['Bonus'] = [1000, 2000, 1000, 2000, 1000]
(b) df['Bonus'] = [1000, 2000, 1000, 1000, 2000, 1000]
(c) df[Bonus] = [1000, 2000, 1000, 2000, 1000]
(d) df.addColumn('Bonus',[1000, 2000, 1000, 2000, 1000])

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

55 What will be the output of the given command?

print(df.size)
(a) 5 (b) 4
(c) (5,4) (d) 20

Page 9 of 9

You might also like