Ip QP Set 2
Ip QP Set 2
Ip QP Set 2
Page 1 of 8
8. The correct statement to read from a CSV file in a dataframe is :
a) <DF>.read_csv(<file>)
b) <File>.read_csv()(<DF>)
c) <DF>=pandas.read(<file>)
d) <DF>=pandas.read_csv(<files>)
9. In Pandas the function used to delete a column or a row in a Data Frame is ?
a) delete
b) del
c) drop
d) pop
10. Which attribute is used to transpose the Data Frame ?
a) Trans
b) Transpose
c) T
d) Tp
11. Method or function to add a new row in a data frame is:
a) loc()
b) iloc()
c) join
d) add()
12. Which of the following command will display a column named ‘city’ from a dataframe ‘df ’?
I. print(df.city)
II. print(df[city])
III. print(df*‘city’+)
IV. print(df.loc*‘city’+)
(a)i and ii (b)ii and iii (c)iii and iv (d) i and iii
13. To display the 3 ,4 and 5 columns from the 6th to 9th rows of a dataframe DF,which
rd th th
Page 2 of 8
18. Using Python Matplotlib _________ can be used to count how many values fall into each
interval .
a) line plot
b) bar graph
c) histogram
d) scatter plot
19. The command used to give a heading to a graph is …………..
a. plt.show()
b. plt.plot()
c. plt.xlabel()
d. plt.title()
20. A ………….graph is a type of chart which displays information as a series of data points
connected by straight line segments.
a) line
b) bar
c) pie
d) boxplot
21. The electronic equivalent of junk mail is known as
a) adware
b) Cyber fraud
c) Spam
d) Packets
22. A ______________ is a unique data trace of a user’s activities, actions, communications or
transactions in digital media.
a. Digital Handprint
b. Digital Footprint
c. Offline Footprint
d. Offline Handprint
23 Digital footprints are also known as _____________
a. Digital data
b. Plagiarism
c. Digital tattoos
d. Digital print
24 Following are the impact of e-waste on the environment. Choose the odd one out.
a. Soil Pollution
b. Water Pollution
c. Air Pollution
d. Sound Pollution
25 IPR stands for:
a. Intelligent Property Rights
b. Intellectual Property Reserve
c. Intellectual Property Rights
d. Intellectual Product Rights
Section – B
Section B consists of 24 Questions (26 to 49). Attempt any 20 questions.
Page 3 of 8
27. 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])
28. Find the output of given code:
S= pd.Series([3,6,8])
print(S.index)
a. Index([0,1,2])
b. Int64Index([0,1,2], dtype=Int64)
c. RangeIndex(start=0,stop=3,step=1)
d. [0,1,2]
29 Assertion (A): If Series is created by specifying integer and NaN value as:
S=pd.Series([5,6,np.NaN]) will produce S as
0 5.0
1 6.0
2 NaN
Reason(R): Pandas automatically convert integer to floating type as NaN is not supported by
integer type.
a. (A) is False but (R) is True
b. (A) is True but (R) is False
c. Both are True but (R) is not correct explanation of (A)
d. Both are True and (R) is correct explanation of (A)
30 Find the output of given code-
>>> import pandas as pd
>>> s=pd.Series(['a','s','r'],index=[2,6,9])
>>> print(s>='s')
a. 2 False
6 False
9 True
b. 2 False
6 False
9 False
c. 2 False
6 True
9 False
d. 2 True
6 False
9 True
31 According to a survey, one of the major asian country generates approximately about 2
million tonnes of electronic waste per year. Only 1.5 % of the total e-waste gets recycled.
Which of the following is not a correct method to manage e-waste .
Page 4 of 8
32 How many values will be there in array1, if given code is not returning any error?
series4 = pd.Series(array1,index = *“Jan”, “Feb”, “Mar”, “Apr”+)
a. 1 b. 2 c. 3 d. 4
33 Which argument must be set with plotting functions for legend() to display the legends ?
a) data
b) label
c) name
d) sequence
34 Which of the following are NOT some common net etiquettes?
a. Refrain from personal abuse
b. Always spam
c. Write clearly and concisely
d. Do not plagiarize
35 US $ 3,50,000 from accounts of four US customers were dishonestly transferred to bogus
accounts. This will give a lot of ammunition to those lobbying against outsourcing in US.
Such cases happen all over the world but when it happens in India it is a serious matter and
we can not ignore it. The incidence given above is an example of....
a. Identity Theft
b. Cyber Trolling
c. Financial Fraud
d. Phishing
36 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)
37 Rita is a new learner for the python pandas, and she is aware of some concepts of python.
She has created some lists, but is unable to create the data frame from the same. Help her
by identifying the statement which will create the data frame.
import pandas as pd
Name=['Manpreet','Kavil','Manu','Ria']
Phy=[70,60,76,89]
Chem=[30,70,50,65]
a. df=pd.DataFrame({"Name":Name,"Phy":Phy,"Chem":Chem})
b. d=("Name":Name,"Phy":Phy,"Chem":Chem)df=pd.DataFrame(d)
c. df=pd.DataFrame([Name,Phy,Chem],columns=['Name',"Phy","Chem","Total"])
d. df=pd.DataFrame({Name:"Name", Phy :"Phy",Chem: "Chem"})
Page 5 of 8
38 Assertion (A) : Data visualization refers to the graphical representation of information and
data using visual elements like charts, graphs and maps etc.
Reason (R) : To install matplotlib library we can use the command pip install matplotlib.
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
39 Assertion (A) : Digital footprint is the trail of data we leave behind when we visit any
website (or use any online application or portal) to fill-in data or perform any transaction.
Reason (R) : While online, all of us need to be aware of how to conduct ourselves, how best
to relate with others and what ethics, morals and values to maintain.
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
40 The act of fraudulently acquiring someone’s personal and private information, such as
online account names, login information and passwords is called as ……………
a. Phishing
b. Fraud
c. Scam
d. Plagiarism
41 Assertion (A) : An Internet troll is a person who deliberately sows discord on the Internet by
starting quarrels or upsetting people.
Reason (R) : We can download and use any material available on the Internet.
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
42 Sanyukta is the event incharge in a school. One of her students gave her a suggestion to use
Python Pandas and Matplotlib for analysing and visualising the data, respectively. She has
created a Data frame “df” to keep track of the number of First, Second and Third prizes won
by different houses in various events.
Page 6 of 8
c. df.next(3)
d. df.tail(3)
45 Considering above DataFrame df which python command use to Choose the correct output
for the given statements:
x=df.columns[:1]
print(x)
a. 0
b. House
c. First
d. Error
46 Considering above DataFrame df Which command will give the output 24:
a. print(df.size)
b. print(df.shape)
c. print(df.index)
d. print(df.axes)
47 Which of the following functions is used to create a line chart?
a) line( )
b) plot( )
c) chart( )
d) plotline( )
48 ___________ is the function to save the graph.
a. savefig()
b. savefigure()
c. savegraph()
d. savechart()
49 Observe the following figure. Identify the coding for obtaining this as output
Page 7 of 8
Section - C Case Study
Section C, consists of 6 Question (50 to 55). Attempt any 5 questions.
ABC Enterprises is selling its products through three salesmen and keeping the records of
sales done quarterly of each salesman as shown below:
Company is storing the above information in a CSV file “Qtrly_Sales.csv”. Mr. Rohit is a
programmer. Company has given him the responsibility to create the program to visualise
the above data. He wrote Python code but he is facing some difficulties. Help him by giving
the solutions of following situation:
Python code:
1 import pandas as pd
2 import ________________ as plt
3 df=__________("Qtrly_Sales.csv")
4 df.plot(__________='bar',
color=['red','blue','brown',’green’])
5 plt.___________('Quarterly Report')
6 plt.xlabel('Salesman')
7 plt.ylabel('Sales')
8 plt._________()
50 Choose the correct Python library out of following options in line 2
a. matplotlib
b. matplotlib.plot
c. py.plot
d. matplotlib.pyplot
51 Choose the correct option to read the csv file in line 3
a. read_csv
b. pd.read_csv
c. pd.get_csv
d. get_csv
52 Choose the correct option to select the type of graph in line 4
A. type
B. kind
C. style
D. graph
53 Choose the correct word to give the heading in line 5
A. label
B. heading
C. title
D. caption
54 Choose the correct word to display the graph in line 8
A. plot()
B. display()
C. showgraph()
D. show()
55 The term CSV means :
a) Common Seperated Values
b) Comma Space Values
c) Common Space Values
d) Comma Seperated Values
Page 8 of 8