Section A
Question. Python data structures are
(a) series,tree,dataframe
(b) series,panel,dataframe
(c) series,panel only
(d) series, binary tree
Answer
B
Question. The head() function requires minimum ……….. parameters.
(a) 0
(b) 1
(c) 2
(d) 3
Answer
A
Question. To get the data type of a Series the property used is
(a) datatype
(b) type
(c) data
(d) dtype
Answer
D
Question. The module that is required to create a Series is
(a) matplotlib
(b) pyplot
(c) pandas
(d) random
Answer
C
Question. The size of a Series is
(a) mutable
(b) non-mutable
(c) mutable if created by a dictionary
(d) mutable if created by a tuple
Answer
B
Question. The property that allows to specify user defined indexes in a dataframe is
(a) order
(b) index
(c) indices
(d) None of these
Answer
B
Question. The columns of DataFrame can be
(a) heterogeneous
(b) homogeneous
(c) Both (a) and (b)
(d) None of these
Answer
A
Question. Given the Series
s1=p.Series([10,20,30,40,50])
print(s1[0:])
Find the output of the above code.
(a) [10,20,30,40,50]
(b) [10,20,30]
(c) [10]
(d) [ ]
Answer
A
Question. Given the Series
scolor=p.Series([12,14,16,18,20,40,60])
print(scolor.head(3))
Find the output of the above code.
(a) [12,14,16,18]
(b) [20,40,60]
(c) [16,18,20]
(d) None of these
Answer
D
Question. Given a dataframe ‘df’ created as :
Index Roll Name Marks
0 1 Ravi 56
1 2 Sheeta 77
2 3 Paromita 89
3 4 Debarati 98
The statement df.ndim will give
(a) 1
(b) 4
(c) 2
(d) 3
Answer
C
Question. Which of the following is not an instance of cyber crime?
(a) Stalking
(b) Bullying
(c) Hacking
(d) E-waste disposal
Answer
D
Question. The Indian IT Act was framed in the year
(a) 2002
(b) 2006
(c) 2000
(d) None of these
Answer
C
Question. The term e-Waste can also be called as
(a) WEEE
(b) WEST
(c) WET
(d) None of these
Answer
A
Question. The iloc function
(a) is label based
(b) is integer position based
(c) gives beginning values
(d) None of the above
Answer
B
Question. A shareware is
(a) free of cost
(b) freely available for a limited period
(c) has some restrictions for use
(d) Both (b) and (c)
Answer
D
Question. Open office is a/an ………… .
(a) documentation
(b) spreadsheet
(c) presentation
(d) office applications suite
Answer
D
Question. The attribute that changes the border color of a histogram is
(a) bordercolor
(b) edgecolor
(c) color
(d) drawcolor
Answer
B
Question. The term plagiarism is not related to
(a) illegal software copy
(b) illegal use of patents
(c) stealing others E-mail password
(d) None of these
Answer
C
Question. Which of the following is compulsory with a line chart?
(a) xlabel
(b) ylabel
(c) title
(d) None of them are compulsory
Answer
D
Question. The character ‘L’ in ‘FLOSS’means
(a) Liberal
(b) Libre
(c) Legal
(d) None of these
Answer
B
Question. Which of the following softwares are open source?
(a) Oracle, MS-Word
(b) Oracle, MySQL
(c) Python, Mozilla Firefox
(d) Python, Adobe Photoshop
Answer
C
Question. Which of the following is not an open source license?
(a) GNU
(b) BSD
(c) Apache
(d) All are open source licenses
Answer
D
Question. Given a dataframe created as:
import pandas as p
Stud=p.Series({‘Name’:[‘Ria’,‘Priya’,‘Jack’],‘Eco’:[56,67,89],‘IP’:[90,87,45],
‘Eng’:[58,78,32]})
Studdf=p.DataFrame(Stud)
print(Studdf[0:2])
(a) Prints rows 0,1,2
(b) Prints rows 0,1
(c) Prints row 0 only
(d) Error in code
Answer
B
Question. The savefig() function
(a) saves a dataframe
(b) saves a series
(c) saves a panel
(d) saves a graph
Answer
D
Question. The head() function when used without any parameters displays ……. rows.
(a) 1
(b) 2
(c) 3
(d) None
Answer
D
Section B
Question. Given a Series
nums=pd.Series([9,8,7,6,5],index=range(0,10,2))
nums[1:3]
Find the output of the given code.
(a) 2 8
(b) 4 7
(c) 2 8
4 7
(d) 2 8
6 7
Answer
C
Question. import matplotlib.pyplot as plt
name=[‘Vishal‘,‘Ani’,‘Sushant’]
marks=[45,50,30]
plt.plot(name,marks,‘r’)
plt.title(“Student Marks”)
plt.legend()
plt.show()
With respect to the above code what does the ‘r’ parameter do?
(a) Color as Red
(b) Line as Solid
(c) Color as Brown
(d) None of these
Answer
A
Question. The property of a dataframe that shows the number of elements in a dataframe is
(a) shape
(b) ndim
(c) size
(d) length
Answer
C
Question. Which of the following is not an e-Waste?
(a) Books
(b) Laptop
(c) Monitor
(d) Motherboard
Answer
A
Question. To replace the default index of a dataframe after it is created, the attribute used is
(a) inplace=True
(b) Inplace=False
(c) inPlace=True
(d) All of these
Answer
A
Question. Given below are two statements:
Statement A The function that resets the index of a series is reset_index().
Statement B The inplace parameter is compulsory.
(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.
Answer
C
Question. import matplotlib.pyplot as plt
rainfall=[12,15,16,2,18,87]
plt.______ (rainfall)
plt.show()
The code above is for plotting a histogram. Fill in the blank to complete the code.
(a) histogram
(b) hist
(c) histchart
(d) Any of these
Answer
B
Question. Bulk volume of calls/messages from looking to be authorised sources is an example of
(a) cyber stalking
(b) bullying
(c) IPR infringement
(d) phishing
Answer
D
Question. Given the statements regarding open source softwares:
Statement A Their source code is available.
Statement B They can be modified.
Statement C They are free.
Statement D They must have a price associated.
Which of the statements represent characteristics of open source softwares?
(a) Statement A and Statement B
(b) Statement B and Statement C
(c) Statement C and Statement D
(d) Statement B and Statement D
Answer
A
Question. Given a Series ‘s’ created by the code:
import pandas as p
s=p.Series([90,67,88,34,52])
The statement print(s[ :-3:-2]) will show
(a) 4 52
(b) 4 52
3 34
(c) 3 88
(d) 0 90
Answer
A
Question. Which of the following proves a website to be authentic?
(a) Padlock
(b) Digital certificate
(c) Starting with https://
(d) All of these
Answer
D
Question. Given the code:
datastud=[[‘Shreya’,20,30],[‘Rakhi’,23,50],[‘Priya’,45,90]]
dfs=pd.DataFrame(datastud)
The statement to add the column names ‘Name’,‘Eng’,’IP’ to the dataframe will be
(a) dfs.fields= [‘Name’,‘Eng’,‘IP’]
(b) dfs.rows= [‘Name’,‘Eng’,‘IP’]
(c) dfs.columns=[‘Name’,‘Eng’,‘IP’]
(d) None of these
Answer
C
Question. The role of SSL is
(a) to encrypt data
(b) to decrypt data
(c) to change data
(d) None of these
Answer
A
Question. Given the code:
import pandas as p
prodict={‘Pno’:1,‘Pname’:‘Pen’,‘Price’:20}
prodict1={‘Pno’:2,‘Pname’:‘Pen’,‘Price’:20,‘Model’:‘Parker’}
prodict.update(prodict1)
print(prodict) # Line1
The output of Line1 is
(a) {‘Pno’:2,’Pname’:‘Pen’,’Price’:20,’Model’:’Parker’}
(b) {‘Pno’:1,’Pname’:‘Pen’,’Price’:20, }
(c) {‘Pno’:1 ,’Price’:20,’Model’:’Parker’}
(d) None of the above
Answer
A
Question. Given the Series:
s1=pd.Series([1.00,1.45,2.73,2.5])
s1[s1<2] # Line1
What will be output of Line1?
(a) 0 1.00
1 1.45
(b) 0 True
1 True
(c) 0 1.00
(d) 1 1.00
Answer
A
Question. Which amongst the following is a open source browser?
(a) Netscape Navigator
(b) Internet Explorer
(c) Google Chrome
(d) Mozilla Firefox
Answer
D
Question. import pandas as pd
color=[‘Blue’,‘Green’,‘Yellow’,‘Red’]
newcolor=[‘Magenta’,‘Cyan’]
s1=pd.Series(color)
s2=pd.Series(newcolor)
print(s1.size+s2.size) #Line 1
The output of Line1 is
(a) 4
(b) 6
(c) 1
(d) 2
Answer
B
Question. Given a code to plot a chart :
import matplotlib.pyplot as plt
plt.plot([‘Ravi’,‘Jack’,‘Steffi’],[65,99,72],‘g’)
The chart is not displayed , what is the reason?
(a) plot() function should be Plot()
(b) show() function is not called
(c) pyplot module does not have plot() function
(d) None of the above
Answer
B
Question. The statement that gives a title “Marks analysis chart” to a chart plotted using the pyplot library object p is
(a) p.heading(“Marks analysis chart”)
(b) p.charttitle(“Marks analysis chart”)
(c) p.title(“Marks analysis chart”)
(d) None of the above
Answer
C
Question. Which of the following is not a protection against malwares?
(a) Antivirus
(b) AVG
(c) Visiting authentic sites
(d) Removing unused files
Answer
D
Question. Given the code:
import matplotlib.pyplot as plt
marks=[45,50,30,65]
plt.plotchart([‘Ravi’,‘Ria’,‘Priya’,‘Akash’],marks,‘r’) # Line1
plt.title(“Student Marks”)
plt.xlabel(“Value”)
plt.ylabel(“Marks”)
plt.legend()
plt.show()
What is the error in Line1?
(a) ‘r’ is an invalid argument
(b) No function called plotchart
(c) Plotting requires more parameters
(d) None of the above
Answer
B
Question. The function to display a horizontal bar chart is
(a) bar()
(b) barh()
(c) barhorizontal()
(d) nobar()
Answer
B
Question. Given the two series
>>>s1 >>>s2
0 10 0 50
1 20 1 60
2 30 2 70
3 40 3 80
Which of the operations is possible?
(a) s1+s2
(b) s1-#s2
(c) s1*s2
(d) All of these
Answer
D
Question. Given the statements with respect to the dataframe “df”:
Statement A df[ : ]=0 will set the entries in row 0 to 0.
Statement B df[: : ]=0 will set all the entries of the dataframe to 0.
(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.
Answer
D
Section C
(Case Study Based Questions)
This section consists of 6 questions (50 to 55). Attempt any 5 questions.
Rahul has written a code with a dataframe and a CSV file “Emp.csv” containing
records of employees as follows:
Index Eno Ename Eage Esal
0 1 Ritesh 15 5600
1 2 Aakash 16 17000
2 3 Sumit 17 12500
3 4 Ria 20 18000
The code is as follows:
import pandas as pd
empdf=______ # Blank1
empdf.head(2)
empdf.sort_values(by=[‘Esal’])
empdf.tocsv(‘C:\\Data\\Empnew.csv’) # To write the dataframe to a CSV file
He wants to read the data from the CSV file , display its first two records , sort it and then rewrite the data to a new CSV file .
Question. The statement in Blank1 to read the data from the file “C:\\Data\\Emp.csv” will be
(a) pd.readcsv(‘C:\\Data\\Emp.csv’)
(b) pd.read (‘C:\\Data\\Emp.csv’)
(c) pd.read_csv(‘C:\\Emp.csv’)
(d) pd.read_csv(‘C:\\Data\\Emp.csv’)
Answer
D
Question. ––––––– is the first column of given file.
(a) Index
(b) Eno
(c) Ename
(d) None of these
Answer
A
Question. The error in the last line of the code is
(a) tocsv should be Tocsv
(b) tocsv should be ToCsv
(c) tocsv should be to_csv
(d) No error
Answer
C
Question. To display only the names of the employees of the dataframe after reading it from the CSV file , the command will be (assuming the column name is ‘Ename’)
(a) print(empdf[‘Ename’])
(b) print(empdf.ename)
(c) print(empdf(ename))
(d) Both (a) and (b)
Answer
D
Question. The data is arranged in
(a) ascending order
(b) descending order
(c) no order
(d) None of these
Answer
A
Question. The output of the statement empdf.shape is
(a) (3,4)
(b) (3,5)
(c) (4,4)
(d) None of these
Answer
C