3. Which is incorrect statement for the Python package NumPy?
a) It is a general-purpose array-processing package
b) NumPy arrays are faster and more compact
c) It is multi-dimensional arrays
d) It is proprietary software
4. The data of any CSV file can be shown in which of the following software?
a) MS Word
b) Notepad
c) Spreadsheet
d) All of the above
5. Which Python library is not used for data science?
a) Panda
b) Numpy
c) Matplotlib
d) Tkinter
6. Which method is used to Delete row(s) from Data Frame?
a) .drop() method
b) .del() method
c) .remove() method
d) .delete() method
7. Consider the following code:
import numpy as np
import pandas as pd
L = np.array([10,20])
X = pd.Series(______) #statement 1
print(x)
Output of the above code is:
-----table
What is the correct statement for the above output in the following statement 1?
a) d = L*3
b) data = L**3
c) L*3
d) [10,20]**3
8. Which library is imported to draw charts in Python?
a) csv
b) matplotlib
c) numpy
d) pandas
9. Which of the following would give the same output as DF/DF1 where DF and DF1 are DataFrames?
a) DF.div(DF1)
b) DF1.div(DF)
c) Divide(DF,DF1)
d) Div(DF,DF1)
10. Which of the following statements is wrong in the context of Data Frame?
a) Two-dimensional size is Mutable.
b) Can Perform Arithmetic operations on rows and columns.
c) Homogeneous tabular data structure.
d) Create Dataframe from numpy ndarray.
11. Which attributes are not used with Data Frame?
a) size
b) type
c) empty
d) columns
12. With the outset of Covid-19 schools started online classes but continuous online classes students’ health issues also started. The practitioner advised the parents to follow a few health tips. Which following health tip should not be suggested?
a) The sitting posture should be correct.
b) Breaks should be taken in between the online classes.
c) To protect the eyes the gadgets should be placed above eye level.
d) Wash the eyes regularly.
13. The following is automatically granted to the creator or owner of any invention.
a) Patent
b) Copyright
c) Trademark
d) License
14. Himanshi sets up her own company to sell her own range of clothes on Instagram. What type of intellectual property can she use to show that the clothes are made by her company?
a) Patent
b) Copyright
c) Design
d) Trademark
15. GPL stands for?
a) Guided Public License
b) General Public License
c) Global Public License
d) General Public letter
16. E-waste is becoming one of the fastest growing environmental hazards in the world today. If it is not properly treated or disposed of it can cause serious health hazards, therefore The ______ has issued a formal set of guidelines for proper handling and disposal of e-waste.
a) Central Pollution Control Board (CPCB)
b) Department of Information Technology (DIT)
c) Electrical and Electronic Equipment (WEEE)
d) Information Communication Technology (ICT)
17. When we create a Data Frame from a list of Dictionaries the column labels are formed by the
a) Union of the keys of the dictionaries
b) Intersection of the keys of the dictionaries
c) Union of the values of the dictionaries
d) Intersection of the value of the dictionaries
18. To change the width of bars in a bar chart, which of the following arguments with a float value is used?
a) hwidth
b) width
c) breath
d) barwidth
19. Identify the correct option to select first four rows and second columns from a DataFrame 'Data'.
a) display(Data.iloc[1: 4, 2:4])
b) display(Data.iloc[1: 5, 2:5])
c) print(Data.iloc[0: 4, 1:4])
d) print(Data.iloc[1: 4, 2:4])
20. Which of the following commands is used to import matplotlib for coding?
a) import matplotlib.pyplot as plt
b) import plt.matplotlib as plt
c) import py.matplotlib as plt
d) import pyplot.matplotlib as plt
21. Consider the following statements with reference to Line charts.
Statement A: A Line graph is a tool for comparison and is created by plotting a series of several points and connecting them with a straight line.
Statement B: You should never use line charts when the chart is in a continuous data set.
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
22. What is not true about Data Visualization?
a) Graphical representation of information and data.
b) Helps users in analyzing a large amount of data in simpler way.
c) Data visualization makes complex data more accessible, understandable and usable.
d) No library needs to be imported to create charts in Python language.
23. Which attribute is used with Series to count the total number of NaN values?
a) size
b) len
c) count
d) count total
24. Consider the following Series in Python:
data = pd.Series([5, 2, 3, 7], index=['a', 'b', 'c', 'd'])
Which statement will display all odd values?
a) print(data % 2 == 0)
b) print(data[data % 2 != 0])
c) print(data mod 2 != 0)
d) print(data[data % 2 != 0])
25. Priya is a student of class 10 and she is a very frequent user of internet applications. One day she got an unpleasant message on her instant messenger. What do you think she should do?
a) Start chatting with an unknown person.
b) Talk to her parents/teacher or other trusted adult and let them know that she is feeling uncomfortable.
c) Ignore the conversation.
d) She should delete the chat so that no one comes to know.
Section B consists of 24 questions (26-49). Attempt any 20 questions.
26. What will be the output of the following code?
import pandas as pd
import numpy
S = pd.Series(data=[31,54,34,89,12,23], dtype=numpy.int)
print(S > 50)
a)
0 False
1 True
2 False
3 True
4 False
5 False
dtype: bool
b)
1 54
3 89
dtype: int64
c)
0 31
1 54
3 89
4 12
5 23
dtype: int64
d)
1 True
3 True
dtype: bool
27. The primary law in India dealing with cybercrime and electronic commerce is?
a) India's Technology (IT) Act, 2008
b) India's Digital Information Technology (DIT) Act, 2000
c) India's Information Technology (IT) Act, 2000
d) The Technology Act, 2008
28. Consider the following statement with reference to Trademark and Hacking.
Statement 1: Trademark is a document that provides legally binding guidelines for the use and distribution of software.
Statement 2: Hacking is the act of unauthorized access to a computer network or any digital system.
a) Statement 1 is True but Statement 2 is False
b) Statement 1 is False but Statement 2 is True
c) Both the statements are True
d) Both the statements are False
29. Consider a following DataFrame:
import pandas as pd
s = pd.Series(data = [31,54,34,89,12,23])
df = pd.dataFrame(s)
Which statement will be used to get the output as 2?
a) print(df.index())
b) print(df.shape())
c) print(df.ndim())
d) print(df.values())
30. Sandhya wants to display the last four rows of the dataframe df and she has written the following command:
df.tail()
But the first 5 rows are being displayed. To rectify this problem, which of the following statements should be written?
a) df.head()
b) df.last(4)
c) df.tail(4)
d) df.rows(4)
31. There is only 1 day left for Ravisha to submit her science project. Therefore she performed the following activities to complete her task. Which of the following activities can be considered as plagiarism?
a) Downloaded the image that were marked as CC and pasted in her project file.
b) Copied the content from some website and pasted in her life.
c) Copied the content from the website and gave references about the same in the project.
d) Downloaded and installed the open source software for typing the synopsis.
32. A contract between the creator and the user to allow the user use his/her work with some price is
a) Agreement
b) Copyright
c) License
d) Patent
33. Consider the following series:
Ser = pd.Series(['C', 'O', 'M', 'F', 'O', 'R', 'T', 'A', 'B', 'L', 'E'], index=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11])
print(Ser[4:])
a)
4 F
5 O
6 R
7 T
8 A
9 B
10 L
11 E
dtype: Object
b)
4 F
5 O
6 R
7 T
8 A
dtype: object
c)
4 F
5 O
6 R
7 T
8 A
9 B
dtype: Object
d)
5 O
6 R
7 T
8 A
9 B
10 L
11 E
dtype: Object
35. Companies get their Trademark registered to protect?
a) Logos, names and brand
b) Word, phrase or symbol
c) Slogans, stylized fonts and colors
d) Company furniture, worker, brands
36. Dataframes can be created from?
a) Lists
b) Dictionaries
c) Series
d) All of the above
37. Rohit forgot his laptop in his car and when he came back he found his laptop was missing. This act is
a) Cyber crime
b) Phishing
c) Theft
d) Plagiarism
38. Consider the following statements:
Statement A: .loc() is a label-based data selecting method to select a specific row(s) or column(s) which we want to select.
Statement B: .iloc() cannot be used with default indices if customized indices are provided.
a) Statement A is True but Statement B is False
b) Statement A is False but Statement B is True
c) Statement A and Statement B both are False
d) Statement A and Statement B both are True
39. Abhay is a student of class 'XII' and he is aware of some concepts of Python. He has created the DataFrame, but he is getting errors after executing the code. Help him by identifying the correct statement that will create the DataFrame:
Code:
import pandas as pd
stuname = {'Muskan', 'Radhika', 'Gopar', 'Pihu'}
term1 = [70, 63, 74, 90]
term2 = [67, 70, 86, 95]
a) df = pd.DataFrame({"Name":stuname, "marks1":term1, "marks2":term2})
b) df = pd.DataFrame([stuname,term1,term2], columns = ['stuName','marks1','marks2'])
c) df = pd.DataFrame({stuname,term1,term2})
d) df = pd.dataframe({stuname,term1,term2})
40. Ms. Kalpana is working with an IT company, and she wants to create charts from the data provided to her.
She generates the following graph:
Which statement is used to mark the line as given in the above fig.?
a) plt.plot(x,y, marker='#', markersize=10, color='red', linestyle='dashdot')
b) plt.plot(x,y, marker='star', markersize=10, color='red')
c) plt.plot(x,y, marker='@', markersize=10, color='red', linestyle='dashdot')
d) plt.plot(x,y, marker='*', markersize=10, color='red')
41. Mr. Raman created a DataFrame from a Numpy array:
arr = np.array([[2, 4, 8], [3, 9, 27], [4, 16, 64]])
df = pd.DataFrame(arr, index=['one', 'two', 'three'], ____)
print(df)
Help him to add customized column labels to the above DataFrame.
a) columns = 'no', 'sq', 'cube'
b) column = ['no', 'sq', 'cube']
c) columns = ['no', 'sq', 'cube']
d) columns = [['no', 'sq', 'cube']]
42. What will be the output of the following program?
import pandas as pd
dic = {'Name': ['Sapna', 'Anmol', 'Rishul', 'Sameep'], 'Agg': [56, 67, 75, 76], 'Age': [16, 18, 16, 19]}
df = pd.DataFrame(dic, columns=['Name', 'Age'])
print(df)
a)
-----table
b)
c)
d)
43. Consider the following code:
import pandas as pd
S1 = pd.Series([23,24,35,56], index=['a', 'b', 'c', 'd'])
S2 = pd.Series([27,12,14,15], index=['b', 'y', 'c', 'ab'])
df = pd.DataFrame(S1 + S2)
print(df)
Output for the above code will be:
a)
-----table
b)
c)
d)
44. Sudhanshu has written the following code to create a DataFrame with Boolean index:
import numpy as np
import pandas as pd
df = pd.DataFrame(data=[[5, 6, 7]], index=[True, False, True])
print(df)
While executing the code, she is getting an error, help her to rectify the code:
a) df = pd.DataFrame([True, False, True], data=[5,6,7])
b) df = pd.DataFrame(data=[5,6,7], index=[True, False, True])
c) df = pd.DataFrame([true, false, true], data=[5,6,7])
d) df = pd.DataFrame(index=[true, false, true], data=[[5, 6, 7]])
45. The rights of the owner of information to decide how much information is to be shared/exchanged/distributed, are collectively known as ________.
a) Intelligent Portable Rights
b) Intellectual Property Rights
c) Interactive Property Rights
d) Instance Portability Rights
46. Abhilasha forgot to sign out from her Gmail ID and Aditi used Abhilasha's Gmail ID to send mail. This act of Aditi is considered as
a) Plagiarism
b) Identity Theft
c) Phishing
d) Digital Activity
47. The trail that is automatically created when a person uses the internet on any digital device like Laptops, smartphones, tablets etc. is called
a) Cyberbullying
b) Phishing
c) Digital Footprint
d) Digital Activity
48. ________ operating system comes under FOSS.
a) Windows
b) Ubuntu
c) Mac
d) Oracle
49. Sushila has created a DataFrame with the help of the following code:
import pandas
EMP = {'EMPID': ['E01 E02, E03', 'E04', 'E05'],'EMPNAME': ['KISHORI', 'PRIYA', 'DAMODAR', 'REEMA', 'MANOJ'], 'EMP SALARY': [67000, 34000, 68000, 90000, 43000]}
df = pandas.DataFrame(EMP, index=['001', '002', '003', '004', '005'])
print(df.loc[0:3,:])
And she wants to get the following output. Help her to correct the code.
-----table
a) print(df.iloc['001':'003', :])
b) print(df.iloc['001': '003', :])
c) print(EMP[loc[0:3,:]])
d) print(df.loc['001':'004', :])
Section C consists of 6 questions (50–55). Attempt any 5 questions.
Case Study
Ms Ramdeep Kaur maintains the records of all students of her class. She wants to perform some operations on the data:
Code:
import pandas as pd
t = {'Rollno': [101, 102, 103, 104, 105, 106, 107], 'Name': ['Shubrato', 'Krishna', 'Pranshu', 'Gurpeet', 'Arpit', 'Sandhiya', 'Aurobindo'], 'Age': [15, 14, 14, 15, 16, 15, 16], 'Marks': [77.9, 70.4, 60.9, 80.3, 86.5, 67.7, 85.0], 'Grade': ['11B', '11A', '11B', '11C', '11E', '11A', '11C']}
df = pd.DataFrame(t, index=[10, 20, 30, 40, 50, 60, 70])
print(df)
Output of the above code:
-----table
Based on the given information, answer questions No. 50–55.
50. Select the correct statement for the below output.
a) print(df.iloc[2])
b) print(df.loc[2])
c) print(df.iloc[20])
d) print(df.loc[20])
51. The teacher wants to know the marks secured by the second last student. Which statement would help her to get the correct answer?
a) print(df.loc[60:70,'Marks'])
b) print(df.loc[60:60, 'Marks'])
c) print(df.iloc[-2:-2, ['Marks'])
d) print(df[-2:-2]['Marks'])
52. Which of the following statement(s) will add a new column 'fee' at second position with values [3200, 3400, 4500, 3100, 3200, 4000, 3700] in DataFrame df?
a) df.insert(loc=2, column='fee', value=[3200, 3400, 4500, 3100, 3200, 4000, 3700])
b) df.add(2, column='fee', value=[3200, 3400, 4500, 3100, 3200, 4000, 3700])
c) df.append(loc=2, 'fee'=[3200, 3400, 4500, 3100, 3200, 4000, 3700])
d) df.insert(loc=2, 'fee',[3200, 3400, 4500, 3100, 3200, 4000, 3700])
53. Which of the following commands is used to delete the column 'Grade' in the DataFrame df?
a) df.drop('Grade', axis=1, inplace=True)
b) df.drop('Grade', axis=0, inplace=True)
c) df.drop['Grade', axis=1, inplace=True]
d) df.delete('Grade', axis=1, inplace=True)
54. Which of the following commands would rename the column 'Marks' to 'Halfyearly' in the DataFrame df?
a) df.rename(['Marks', 'Half Yearly'], inplace=True)
b) df.rename({'Marks', 'Halfyearly'}, inplace=True)
c) df.rename(columns={'Marks':'halfyearly'}, inplace=True)
d) df.rename(['Marks':'Halfyearly'], inplace=True)
55. Which of the following commands will display the Names and Marks of all students getting more than 80 marks?
a) print(df.loc['Marks'] > 80,['Name','Marks'])
b) print(df.loc[df['Marks'] < 80,'Name','Marks'])
c) print(df.loc[df['Marks'] < 80,['Name','Marks']])
d) print(df.loc[df['Marks'] > 80,['Name','Marks']])