Page 1 :
KENDRIYA VIDYALAYA SANGATHAN, LUCKNOW REGION, Pre-Board Examination Term-I, Subject: Informatics Practices (Code-065), , Time Allowed: 90 minutes, , Class – XII, , Maximum Marks: 35, , General Instructions:, 1., 2., 3., 4., 5., , 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 (0.77 for each)., , Section – A, Section A consists of 25 questions, attempt any 20 questions, 1, Consider a series, S= pd.Series(10, index=[10,20,30])., What will be output of the following command?, >>> print(S[20]), a. error, b. 20, c. 10, d. 30, 2, Which of the following object you get after reading CSV file by using pandas?, a) DataFrame, b) Character Vector, c) Panel, d) All of the mentioned, 3, , Observe the following code :, import pandas as pd, data = {, "calories": [420, 380, 390],, "duration": [50, 40, 45], }, df = pd.DataFrame(data), What will be the output of, >> print(df.loc[0]), a) calories, 420, b) calories, 420, duration, 380, duration, 50, Name: 0, dtype: int64, Name: 0, dtype: int64, c), , 4, , calories, 390, duration, 45, Name: 0, dtype: int64, , d), , calories, 0, duration, 0, Name: 0, dtype: int64, , The command used to create an empty series as Series([ ], dtype: float64), a), S=pd.Series( ), b), S=pd.Series(np.Nan), c), S=pd.Series(empty), d), None of these, , Page 1|8
Page 2 :
5, , In a Series, to know about the dimensions(number of axis), we use, a), <objectname>.ndim, b), <objectname>.dim, c), <objectname>.nsize, d), <objectname>.nbytes, , 6, , Identify the code to put the values along with missing values in a series, a), Obj=pd.Series([7.2,NaN,7.3]), b), Obj=pd.Series([7.2,np.NaN,7.3]), c), Obj=pd.Series([7.2,NULL,7.3]), d), Obj=pd.Series([7.2,NaN.np,7.3]), , 7, , Using Python Matplotlib, out of the following which can be used to count, how many values fall into each interval, a), Line plot, b), Bar graph, c), Histogram, d), Charts, , 8, , Which of the following is not a valid plotting function in pyplot?, a), bar( ), b), hist( ), c), histh( ), d), barh( ), , 9, , Which of the following functions is used to check the number of rows in, a DataFrame?, a), print(length(df)), b), print(length.df), c), print(len(df)), d), print(length[df]), , 10, , _______________ command is used to display a graph in the output window., a), plt.title( ), b), plt.xlabel( ), c), plt.show( ), d), plt.plot( ), , 11, , In given code dataframe ‘D1’ has ________ rows and _______ columns., import pandas as pd, LoD = [{‘a’:10, ‘b’:20}, {‘a’:5, ‘b’:10, ‘c’:20},{‘a’:7, ‘d’:10, ‘e’:20}], D1 = pd.DataFrame(LoD), a), , 3, 3, , b) 3, 4, , c) 3, 5, , d ) None of the above, , 12, , ____________ is an attempt to steal, spy, damage or destroy computer systems,, networks or their associated information., a., Cyber-security, a), Cyber attack, b), Digital hacking, c), Computer security, , 13, , The full form of Malware is ________, a), Malfunctioned Software, b), Multipurpose Software, c), Malicious Software, d), Malfunctioning of Security, , Page 2|8
Page 3 :
14, , By encryption of a text we mean, a), Compressing it, b), Expanding it, c), Scrambling it to preserve its security, d), Hashing it, , 15, , Which of the following is not a type of cybercrime?, a), Data theft, b), Forgery by using electronic media specially Internet, c), Damage to data and systems intentionally, d), All above, , 16, , Online posting of rumours, giving threats online, posting the victim’s personal, information, comments aimed to publicly ridicule a victim is termed as __________, a), Cyber bullying, b), Digital Signature, c), Cyber insult, d), d. All of the above, , 17, , Online personal account, personal websites are examples of:, a., Digital Wallet, b., Digital Property, c., Digital Certificate, d., Digital Signature, , 18, , 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, , 19, , After practical, Monika left the computer laboratory but forgot to sign off from her email, account. Later, her classmate Sonam started using the same computer. She is now logged, in as Monika. She sends inflammatory email messages to few of her classmates using, Monika’s email account. Sonam’s activity is an example of which of the following, cyber-crime?, a) Plagiarism, , b) Hacking, , c) Identity theft, , d) Cyber bullying, , 20, , ________ are websites or applications that enable users to participate by creating, and sharing content with others in the community., a., Social media, b., Social channel, c., Social networking, d., None of the above, , 21, , Which method is used to access vertical subset of a DataFrame?, a., iterrows( ), b., iteritems( ), c., itertuples( ), d., itercols( ), , 22, , The legal and regulatory aspects of the Internet refer to ______________., a), Cyber Space, b), Cyber crime, c), Criminal law, d), IT Act, , Page 3|8
Page 4 :
23, , Assume an empty DataFrame df. The command, df.loc[‘a’] = [‘A’, ’B’, ’C’], will add a new, a. Row to the DataFarme, b. A new column to the DataFrame, c. Will generate an error, d. None, , 24, , Function used to delete a row from a DataFrame is:, a., , 25, , remove( ), , b., , delete( ), , c., , del, , d., , drop( ), , By default the plot function plots a _________________, a), Histogram, b) Pie chart, c), Pie chart, d) Line chart, , Section – B, Section B consists of 24 Questions (26 to 49). Attempt any 20 questions., 26, , Consider the following graph (Figure 26). Identify the code to plot it., a., b., c., d., , import matplotlib.pyplot as plt, plt.plot ([2,7],[1,6]), plt.show( ), import matplotlib.pyplot as plt, plt.plot([1,6],[2,7]), plt.show( ), import matplotlib.pyplot as plt, plt.plot([2,3],[5,1]), plt.show( ), import matplotlib.pyplot as plt, plt.plot([1,3],[4,1]), plt.show( ), Figure for Question 26, , 27, , How many values will be there in array1, if given code is not returning any error?, >>> series4 = pd.Series(array1, index = [“Del”, “Che”, “Mub”, “Agr”]), a. 1, b. 2, c. 3, d., 4, , 28, , Read the statements given below and identify the right option, Statement A: A Line plot is a graph that shows the frequency of a data along a, number line., Statement B: The legend is displayed by default associating the colours with the, plotted data., a. Statement A and B are correct and Statement B is correct Explanation of, statement A., b., Statement A and B are correct and Statement B is not correct Explanation of, statement A., c., Statement A is correct, but Statement B is incorrect, d. Statement A is incorrect, but Statement B is correct, , 29, , Which of the following statement will create an empty series named “S1”?, a., c., , S1 = pd.Series(None), Both of the above, , b. S1 = pd.Series( ), d. None of the above, , Page 4|8
Page 5 :
30, , How many elements will be there in the series named “S1”?, >>> S1 = pd.Series(range(5)), >>> print(S1), a. 5, b. 4, c. 6, d. None of the mentioned, , 31, , Write the output of the following :, >>> S1=pd.Series(14, index = ['a', 'b', 'c']), >>> print(S1), a), b), a 14, b 14, c 14, dtype: int64, c), , 32, , Error, , d), , None of the above, , The fraudulent practice of directing internet users to a bogus website that mimics, the appearance of legitimate one in order to obtain personal information such as, passwords, accounts numbers etc. This is known as ____________________, a) Eavesdropping, c) Bulling, , 33, , a 14, dtype: int64, , b) Pharming, d) Trolling, , All pandas data structures are ______ mutable but not always _______ mutable., a) size, value, c) value, size, , b) semantic, size, d) none of the mentioned, , 34, , ____________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, , 35, , Abdul deleted all his chats from all his social media accounts, and he thinks that all, his traces are deleted completely. Is he right in thinking so?, a., , 36, , Yes, , b., , No, , c., , May be, , Not sure, , Which function will be used to read data from a CSV file into pandas data frame?, a., , readcsv( ), , b. to_csv( ), , c. read_csv( ), , 37, , ________________ operating system come under FOSS., a. Ubuntu, b. iOS, c. Mac, , 38, , ___________ package come under FOSS., a. Libre Office, c. Both of the above, , 39, , d., , d. csv_read( ), d. Windows, , b. Open Office, d. None of the above, , What will be the output for the following code ?, import pandas as pd, import numpy as np, S = pd.Series (np.random.randn(2)), print (S.size), (a) 0, (b) 1, , (c) 2, , (d) 3, Page 5|8
Page 6 :
40, , 41, , 42, , 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>), Assuming the given series, named stud, which command will be used to print 5 as, output?, Amit, 90, Ramesh 100, Mahesh 50, John, 67, Abdul, 89, Name: Student, dtype: int64, a. stud.index, b. stud.length, c. stud.values, d. stud.size, A social science teacher wants to use a pandas series to teach about Indian, historical monuments and its states. The series should have the monument, names as values and state names as indexes which are stored in the given, lists, as shown in the code. Choose the statement which will create the, series:, import pandas as pd, Monument=['Qutub Minar','Gateway of India','Red Fort','Taj Mahal'], State=['Delhi','Maharashtra','Delhi','Uttar Pradesh'], a., b., c., d., , S=pd.series(Monument,index=State), S=pd.Series(Monument,index=State), S=pd.Series(State,Monument), S=df.Series(Monument,index=State), , 43, , Which command will be used to delete 3 and 5 rows of the data frame? Assuming, the data frame name as DF., a. DF.drop([2,4],axis=0), b. DF.drop([2,4],axis=1), c. DF.drop([3,5],axis=1), d. DF.drop([3,5]), , 44, , Radhika 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 6|8
Page 7 :
45, , 46, , 47, , Difference between loc() and iloc():, a. Both are Label indexed based functions., b. Both are Integer position-based functions., c. loc() is label based function and iloc( ) integer position based function., d. loc() is integer position based function and iloc( ) index position based, function., What we are doing in the following statement?, dF1=dF1.append(dF2), #dF1 and dF2 are DataFrame object, a. We are appending dF1 in dF2, b. We are appending dF2 in dF1, c. We are creating Series from DataFrame, d. None of the above, Write the output of the statement, >>>df.shape, if df has the following structure., Name, 0 Amit, 1 Anil, 2 Ravi, , 48, , Rollno, 1, 2, 3, , a. (3, 4), b. (4, 3), Write the output of the statement, >>>df.empty ,, if df has the following structure:, Name, 0 Amit, 1 Anil, 2 Ravi, , 49, , Class, 6, 7, 8, , Class, 6, 7, 8, , c. (3, 3), , d. None of the above, , Rollno, 1, 2, 3, , a. True, b. False, c. 0, d. None of the above, To read specific number of rows from CSV file, which argument is to be given in, read_csv ( ) ?, (a) rows = <n>, (c) n_rows - <n>, , (b) nrows = <n>, (d) number_rows = <n>, , Section C, Section C consists of 6 Question (50 to 55). Attempt any 5 questions., Case Study, Rabhat made following data frame as df., , Page 7|8
Page 8 :
50, , Which statement will print the size of the data frame ?, a., c., , 51, , b., d., , print(df.Size), print(df.size( )), , Choose the Python statement to display only name of student of last two rows of above, data frame., a), c), , 52, , print(df.size), print(df.Size( )), , df.loc[0:2,‘Name’), df.loc[0:2,1], , b), d), , df.loc[0:1,0:1]), df.loc[1:2,’Name’], , Salvia, a student needs to display the record of student whose roll number is 103., Help her to identify the correct set of statement/s from the given options :, (a) df1=df[df[‘rollno’]==103], print(df1), (b) df1=df[rollno==103], print(df1), (c) df1=df[df.rollno=103], print(df1), (d) df1=df[df.rollno==103], print(df1), , 53, , What will be the output of print(df.loc[ : 1,’Rollno’ : ’Marks’]), a), b), , c), d), 54, , Which of the following command will display the column labels of the DataFrame?, (a), (c), , 55, , print(df.columns( )), print(df.column), , (b), (d), , print(df.column( )), print(df.columns), , The class teacher wants to add a new column, Grade with the values, ‘B’, ‘A’, ‘A’, to, the DataFrame. Help her choose the command to do so:, (a) df.column=[’B’,’A’,’A’], (b) df [‘Grade’]=[’B’,’A’,’A’], (c) df.loc[‘Grade’] =[’B’,’A’,’A’], (d) Both (b) and (c) are correct, --x-, , Page 8|8
Page 9 :
KENDRIYA VIDYALAYA SANGATHAN, LUCKNOW REGION, Pre-Board Examination Term-I, Subject: Informatics Practices (Code-065), Time Allowed: 90 minutes, Class – XII, 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., , Answer Key, , 1, , Correct, Opt, C, , 21, , Correct, Opt, B, , 41, , Correct, Opt, D, , 2, , A, , 22, , D, , 42, , B, , 3, , B, , 23, , C, , 43, , C, , 4, , A, , 24, , A, , 44, , A, , 5, , A, , 25, , D, , 45, , C, , 6, , B, , 26, , A, , 46, , B, , 7, , C, , 27, , D, , 47, , C, , 8, , C, , 28, , B, , 48, , B, , 9, , C, , 29, , C, , 49, , B, , 10, , C, , 30, , A, , 50, , A, , 11, , C, , 31, , A, , 51, , D, , 12, , B, , 32, , B, , 52, , A, , 13, , C, , 33, , C, , 53, , A, , 14, , C, , 34, , A, , 54, , D, , 15, , D, , 35, , B, , 55, , B, , 16, , A, , 36, , C, , 17, , B, , 37, , A, , 18, , B, , 38, , C, , 19, , C, , 39, , C, , 20, , A, , 40, , D, , Ques.No, , Ques.No, , Ques.No
Page 10 :
Practice Test Paper, Term-I, Subject: Informatics Practices (Code-065), 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., , 2., , 3., , 4., , 5., , 6., , 7., , 8., , Pandas provide _____________ types of data structures., a) Two, b) One, c) Three, d) Four, Which of the following is false for Pandas?, a) Numpy gets automatically installed when Pandas is installed., b) Pandas can be installed without Python installed in the PC., c) Pandas DataFrame is a two-dimensional data structure, d) Pandas is a python library for data analysis., Pandas Series is __________ and _________________, a) Heterogenous, size mutable, b) Heterogenous, size immutable, c) Homogenous, size immutable, d) Homogenous, size mutable, Which of the following sequence is correct for Pandas?, a) Load, prepare, model, manipulate, analyze, b) Load, model, prepare, manipulate, analyze, c) Load, prepare, manipulate, model, analyze,, d) Load, model, manipulate, prepare, analyze, For the Series data=pandas.Series([10,20,30,40,50]), which of the following will give you answer as 5., a) data.index, b) data.size, c) data.values, d) data.shape, Which of the following data types is not allowed to be used as index for a DataFrame?, a) String, b) Integer, c) Alphabets, d) Lists, Which function in matplotlib is used to display a graph?, a) plot(), b) show(), c) display(), d) print(), How many edges are present in a histogram?, a) bins, b) bins+2, c) bins+1, d) Always 10
Page 11 :
9., , 10., , 11., , 12., , 13., , 14., , 15., , 16., , 17., , 18., , Which of the following functions is used to add a column to an existing DataFrame?, a) append(), b) insert(), c) concat(), d) add(), Which of the following is not an attribute in bar() function while plotting?, a) alpha, b) linestyle, c) colour, d) width, , The digital data trail we leave online intentionally is called________________, a) Passive digital footprint, b) Active digital footprint, c) Latest digital footprint, d) Action digital footprint, Which of the following activity is an example of leaving passive digital footprints?, a) A website logging the IP address., b) Sending E-mail to a friend, c) Posting a comment on Facebook, d) All the above., Hacking, when done with a malicious intent, is called ______, a) Ethical hacking, b) Active hacking, c) Passive hacking, d) Cracking, Which is the correct function for reading a csv file into pandas, a) readcsv(), b) read-csv(), c) read_csv(), d) csv_read(), Which of the following is not a IPR infringement?, a) Plagiarism, b) Trademark infringement, c) Patent infringement, d) Copyright infringement., A ___________ is some lines of malicious code that attaches itself to a host file in the target PC to cause, damage to the system., a) Worm, b) Virus, c) Trojan, d) Adware, Which attribute of a DataFrame returns the number of rows and columns as a tuple?, a) size, b) T, c) index, d) shape, Logo of the software company will be protected by _____________, a) Trademark, b) Patent, c) Copyright, d) License
Page 12 :
19., , 20., , 21., , 22., , 23., , 24., , 25., , 26., , 27., , Which function in Pandas is used to remove a row or a column from a DataFrame?, a) reject(), b) delete(), c) remove(), d) drop(), What is the good way to dispose e-waste?, a) Throw it in the garbage bin, b) Sell it to a local scrap dealer, c) Deposit with a registered E-waste dealer, d) Burn it in your backyard, What was the main purpose of Indian IT Act 2000?, a) Providing Legitimacy to Digital Certificate, b) Granting legal recognition to E-commerce, c) Providing laws against Cyber Crimes., d) All the above., Which of the following is an example of FOSS Operating System?, a) Open Office, b) Firefox, c) Ubuntu Linux, d) IOS, Pandas DataFrame can be created using, a) List of Dictionaries, b) Dictionary of lists, c) Dictionary of Dictionaries, d) All the above, Which method in Pandas can be used to add multiple rows to a DataFrame?, a) append(), b) add(), c) extend(), d) concat(), For a given DataFrame df, which statement will change the values for every row of a given column ‘Rate’, to 100, a) df.rate=100, b) df['rate']=100, c) Both a) and b), d) Only b), Section – B, Section B consists of 24 Questions (26 to 49). Attempt any 20 questions., What will be the output of the following code?, import pandas as pd, arr = [1,2,3,4], d = pd.Series(data = arr*2), print(d[4]), a) 2, b) 5, c) 8, d) 1, Which of the following statements will create a Series object?, a) s = pandas.series(), b) s = pandas.Series(), c) s = pandas.Series([1,2,3,4,5]), d) Both b) and c) can create a Series object.
Page 13 :
28., , 29., , What will be the output of the given Series operation?, import pandas as pd, data = pd.Series([2,4,6,8,10], index=['a','b', 'c','d','e']), print(data[1:4:2]), a), , b), , c), , d), , A _____________ is a type of intellectual property that gives its owner the legal right to exclude others, from making, using, or selling an invention for a limited period of years., a) Copyright, b) Trademark, c) License, d) Patent, 30., Observe the given plot and identify the correct set of statements, that created it., , a) import matplotlib.pyplot as plt, data = [1,2,3,4,5,1,2,3,2,5,6,7,2,1,3,3,4,5,6,7,7,8,8,8,8,9,9,10,10,11,11,11], plt.hist(data, bins=15, histtype='cumulative'), plt.show(), b) import matplotlib.pyplot as plt, data = [1,2,3,4,5,1,2,3,2,5,6,7,2,1,3,3,4,5,6,7,7,8,8,8,8,9,9,10,10,11,11,11], plt.hist(data, bins=15, histtype='barstacked'), plt.show(), c) import matplotlib.pyplot as plt, data = [1,2,3,4,5,1,2,3,2,5,6,7,2,1,3,3,4,5,6,7,7,8,8,8,8,9,9,10,10,11,11,11], plt.hist(data, bins=15, cumulative=True), plt.show(), d) import matplotlib.pyplot as plt, data = [1,2,3,4,5,1,2,3,2,5,6,7,2,1,3,3,4,5,6,7,7,8,8,8,8,9,9,10,10,11,11,11], plt.hist(data, bins=15, barstacked=True), plt.show()
Page 14 :
31. Read the statements given below and identify the right option to draw a bar graph., Statement A: To make a bar graph in matplotlib, we need to use the bar() function, Statement B: A bar chart describes the comparisons between the discrete categories., a) Only Statement A is correct, b) Only Statement B is correct, c) Both statements A and B are incorrect, d) Both statements A and B are correct, 32. Minimum, how many datapoints are there in the given line graph., , a) 2, b) 3, c) 4, d) 5, 33. ___________________is a set of strategies and processes you can use to secure the privacy, availability,, and integrity of your data., a) Data integrity, b) Data protection, c) Data sanitization, d) Data vandalization, 34. Consider the following statements while using internet:, Statement A: Always make real people a priority, Statement B: Include anonymous people in conversation, Statement C: Respect people’s privacy, Statement D: Respond to all emails promptly., Which of the above statements are legitimate net-etiquettes?, a) Statement A and B, b) Statement A and D, c) Statement B and C, d) Statement A and C, 35. Which of the following Pandas series operations will produce the given output:, , a) import pandas as pd, s = pd.Series([8,9,3,5,2,6,7],index = ['a','b','c','d','e','f','g']), print(s>5), b) import pandas as pd, s = pd.Series([8,9,3,5,2,6,7],index = ['a','b','c','d','e','f','g']), print(s[s>5]), c) import pandas as pd, s = pd.Series([8,9,3,5,2,6,7],index = ['a','b','c','d','e','f','g']), print(s[0::2]), d) import pandas as pd, s = pd.Series([8,9,3,5,2,6,7],index = ['a','b','c','d','e','f','g']), print(s[s>=5])
Page 15 :
36. Stella, a student of class 11 is an active social media user. Of late she started receiving obscene text and, images in her messenger. What do you think she should do?, a) Ignore the messages and continue using social media., b) Block the messages and ignore the harassment she faced with the messages., c) Block the user and complain to local Cyber cell by the help of parents, d) Stop using social media., 37. Which of the following statements will print the first and second rows in the given DataFrame df?, , a) df ['a':'b'], b) df.loc ['a':'b'], c) df.loc[0:1], d) df[0:1], 38. Which of the following is not a cause for e-waste?, a) Growth in technology, b) Improper dumping of discarded electronic devices., c) Population getting tech savvy., d) Population getting poorer., 39. Which of the following statements is false?, a) iloc[] is integer position based slicing., b) In loc[] the value at end index label is ignored., c) In iloc[] we can use step parameter too., d) loc[] can be used to modify data in a DataFrame., 40. What will be the output of the given program based on Pandas Series?, import pandas as pd, s = pd.Series([5,10,15,20],index = ['a','b','c','d']), p = s[2:], p[0]=100, print(s), a), , b), , c), , d), , 41. Which of the following is not a violation of IPR?, a) Using a logo of a registered firm without permission., b) Using patented formula of another firm for financial gains., c) Forwarding an email received from someone to a friend., d) Writing copyrighted software on CD and selling them for profit.
Page 16 :
42. For the given DataFrame df, which statement is going to delete the row s3?, , a) df.drop(labels= 's3'), b) df.drop('s3', axis=0), c) df.drop('s3', axis=1), d) Both a) and b), 43. What will be the output of the following Series operation?, import pandas as pd, s = pd.Series([2,3,4,5,6], index=['a','b','c','d','e']), print(s%3==0), a), b), , c), , d), , 44. Robin wants to create a DataFrame from the three lists given below. The data for each column in the, DataFrame will be derived from the three lists respectively. Help him with the correct solution to create, the DataFrame., name=['TOM','BOB','JIM'], age = [17,16,15], hobby = ['Soccer','Dance','Music'], a) df = pd.DataFrame([name,age,hobby], columns=['Name','Age','Hobby']), b) df = pd.DataFrame({'Name':name, 'Age':age,'Hobby':hobby}), c) df = pd.DataFrame([{'Name':name},{'Age':age},{'Hobby':hobby}]), d) df = pd.DataFrame((name, age,hobby), columns=['Name','Age','Hobby']), 45. India introduced Section ______ in its amendment of IT Act in 2008, which penalized sending "offensive, messages"., a) 66C, b) 66A, c) 66B, d) 66D, 46. Based on the following DataFrame, what will be the output of the given statement., , df.loc[df.population>100,'income']=1500, print(df)
Page 17 :
a), , b), , c), , d), , 47. Considering the given DataFrame df , what will be the output of the statements that follows?, , print(df.iloc[1:3,:]), a), , b), , c), , d), , 48. How many rows and columns are there in the DataFrame created out of the following satements?, import pandas as pd, df = pd.DataFrame([[90,'A'],[75,'B',5],[60,'C'],[45,'D',8]]), a) 3 rows and 4 columns, b) 4 rows and 3 columns, c) 4 rows and 4 columns, d) 3 rows and 3 columns, 49. Read the following statements and identify the right option that justifies the statements., Statement A: Pandas DataFrame can be thought of as a dictionary-like container for Series objects, Statement B: Pandas DataFrames are containers for homogenous datatypes., a) Statement A is correct and statement B is incorrect, b) Both statements are correct, c) Both statements are incorrect, d) Statement B is correct and statement A is incorrect
Page 18 :
Section - C, Section C, consists of 6 Question (50 to 55)., Attempt any 5 questions., Case Study, Harshit created a DataFrame for his research work with Python Pandas. The code for the DataFrame and, its output is as under. He wants to perform some opertions on his DataFrame. Help him with correct, code options., import pandas as pd, d1 = {'rollno':[101,102,103,104,105], 'name': ['Pat','Sid','Tom','Kim','Ray'],\, 'marks':[90,40,50,80,65]}, df1 = pd.DataFrame(d1), df1.index = ['a','b','c','d','e'], , 50., , 51., , 52., , 53., , 54., , 55., , Help him with the addition of a column grade with data ['A','D','C','B','C'], a) df1.add('grade',['A','D','C','B','C']), b) df1['grade']= ['A','D','C','B','C'], c) df1.grade=['A','D','C','B','C'], d) pd.grade=['A','D','C','B','C'], Help him to add 5 marks to the students who got more than 80., a) df1['marks']>80=df1.marks+5, b) df1.loc[df1.marks>80]=df1.marks+5, c) df1.loc[df1.marks>80,'marks']=df1.marks+5, d) None of the above., Help him to display the last two rows of the DataFrame, a) print(df1.tail()), b) print(df1[tail(2)]), c) print(pd.tail(2)), d) print(df1.tail(2)), Help him to delete the first two rows in the DataFrame so that the original DataFrame gets modified, a) df1.drop(['a','b'], axis=0, inplace=True), b) df1.drop([0:2], axis=0, inplace=True), c) df1.drop(df1.loc(['a','b'], axis=1, inplace=False), d) df1.drop(['a','b'], axis=0, inplace=False), Help him to display the number of rows and columns in his DataFrame, a) df1.index, b) df1.size, c) df1.shape, d) df1.hasnans, Help him to get the rows reversed and saved in another DataFrame df2, a) df2=df1.loc[::-1], b) df2=df1.reindex(['e','d','c','b','a']), c) df2=df1.iloc[::-1], d) Both b) and c) are correct
Page 19 :
KENDRIYA VIDYALAYA NO. 1 JALAHALLI WEST, OMR ANSWER SHEETT, , Name of Exam: Prac, Name of the Student:, , Test, , Subject:, , Ashok, , Class&Section:, , Date of Exam:, , Roll No:, , Invigilator's signature, WRONG METHODS, , AB, , Que, , IP, , C, , D, , O O, , CORRECT METHOD|, , O OO, Que, , A, , B, , C, , D, , 21 O, , 41, , 22 O OD, , 42, , 23 OO O, , sOO, , 25 OO, 26 O O, , 6 OO O, , O, , O, , O, , 30 O O, , O, , 13 O O O, , 34 O, 35 O, , 14 OO, 15, , OO, , 17 O O O, , 48 O, , O, , O, , O, , 50O, , O, , O, , 51 O O, , O, O O, , 19 O OO, , 38 O, , C, , O, , O, , 39, , O, , 53, O O O, 54 OO, O, 55 O O OO, , 36, , 37 O, o, , 47 OOD, , O, , 32 OO O, 33 O, OO, , 12, , 20 O O, , D, , O, , 46, , 31 O OO, , O, , O, , C, , O, , 29 OO O, , 19, 18, , B, , 43 OO, , 27 OO O, 28, , 16 O, , A, , 24 OO O, , 4, , 11 O, , Que, , 40 O O, , O, , Instructionsfor filling the sheet:, , 1) This sheet should not be folded., 2) Use only BLUE/BLACK ball point pen to fill circles., , 57 O O, 58 OC, 59 OO, 60 O O, , OO, O O, O, O O, , For Examiner's Use:, , Total Marks Obtained, , 3) Don't use pencil., 4) There is no negative marking for a wrong answer, 5) Filling two circles against any question will lead to, Disqualification of that question., 6) In addition to filling the circle, the student should write, the correct option in the box given., , Examiner's, , Signature
Page 20 :
KENDRIYA VIDYALAYA SANGATHAN, TERM 1 - 2021, Informatics Practices, Max. Marks: 35, 03:00 Hrs, General Instructions :, Each question carries 1 mark., 1., , 2., , 3., , 4., , 5., , 6., , 7., , 8., , 9., , 10., , Class XII, Duration:, , SECTION A solve any 20 – first 20 will be considered out of your solution, CSV stands for:, (a) Comma Separated Variables, (b) Comma Separated Variables, (c) Column Separated Values, (d) Column Separated Values, In a dataframe, axis-0 is for, (a) Rows, (b) Columns, (c) Rows and Columns both, (d) None of these, To get the number of elements in a dataframe, _____ attribute may be used., (a) size, (b) shape, (c) values, (d) ndim, To suppress first row as header, which of the following arguments is to be given in read_csv( )?, (a) header = None, (b) noheader = True, (c) skipheader = True, (d) header = Null, Which argument in hist() is used to create a stacked bar type histogram ?, (a) histt, (b) histtype, (c) type, (d) barstacked, The datapoints plotted on a graph are called __., (a) points, (b) pointers, (c) markers, (d) marks, Sudhanshu has deleted all his chats from all his social media accounts, and he thinks that all his, traces are deleted completely. Is he right in thinking so?, (a) Yes, (b) No, (c) May be, (d) Not sure, Pyplot is an interface of Python's _____ library., (a) seaborn, (b) plotly, (c) matplotlib, (d) ggplot, PANDAS stands for _____________, a. Panel Data Analysis, b. Panel Data analyst, c. Panel Data, d. Panel Dashboard, Which of the following command is used to install pandas?
Page 21 :
11., , 12., , 13., , 14., , 15., , 16., , 17., , 18., , 19., , a. pip install pandas, b. install pandas, c. pip pandas, d. None of the above, Python pandas was developed by?, a. Guido van Rossum, b. Travis Oliphant, c. Wes McKinney, d. Brendan Eich, Result of an operation between unaligned Series will have _______ of indexes involved., a. intersection, b. union, c. total, d. all of the mentioned, Which of the following statement will create an empty series named “S1”?, a. S1 = pd.Series(None), b. S1 = pd.Series( ), c. Both of the above, d. None of the above, Complete the following code – _____________________ #missing statement, D = {'code' : [102 , 104, 105 ], 'ename' : ['Arun', 'Geet', 'Amy'] }, df1 = pp.DataFrame(D), print(df1), a) import pandas, b) import pandas as pp, c) import Pandas as pp, d) import pandas as pd, Write correct Python statement to display 2nd column of DataFrame DF., a) DF[2], b) DF[[2]], c) DF.loc[:,2], d)All of the above, Explain the meaning of print(df.iloc[:4]) where df is a dataframe., a) It will display first 4 rows of DataFrame df., b) It will display 4th row of DataFrame df., c) It will display last 4 rows of DataFarme df, d) None of these, Write a Statement in python to create a series, which starts at 3, ends at 13 , with a difference of, (step value of ) 3.5, a. S= pd.Series(range(3,13, 3.5)) b., b. S=pd.Series(np.arange(3,13,3.5)), c. c. S= pd.Series(range(3:13:3.5)) d., d. S=Spd.Series(np.arange(3:13:3.5)), The function used to iterate over vertical subset of dataset of a DataFrame is :, a. iterrows(), b. itercols(), c. iteritems(), d. None of the above, Identify the right type of chart using the following hints., Hint 1: This chart is often used to visualize a trend in data over intervals of time., Hint 2: The line in this type of chart is often drawn chronologically., a. Line chart, b. Bar chart, c. Pie chart, d. Scatter plot
Page 22 :
20., , 21., , 22., , 23., , 24., , Which of the following statements is used to create a histogram with 20 bins?, a. plt.histogram(x, bin = 20), b. plt.hist(x, bins = 20), c. plt.histogram(x, bins = 20), d. plt.hist(x, bin = 20), e-waste is responsible for air, water and land pollution.(T/F), a. True, b. False, The process of re-selling old electronic goods at lower prices is called ____, a. refurbishing, b. recycle, c. reuse, d. reduce, Pandas supports which of the following types of indexes?, a. Positional and Labelled Indexing, b. Numbered and Valued Indexing, c. Row and Column Indexing, d. Loop Indexing, Observe this code and select the answer for how many rows and columns will be generated using, this code:, import pandas as pd ld = [{'x':50, 'y':70}, {'x':35,'y':55, 'z':75}], dfld = pd.DataFrame(ld), print(dfld), a) 3,2, b) 2,3, c) 1,3, d) Error, , 25., , 26., , Which is the best analogy of digital footprint:, A. Our footprint when we walk over sand of sea beach, B. Our footprint when we walk over the cement road constructed few minutes back, C. Our footprint when we enter inside our home with dirty feets., D. All of the above, , SECTION B solve any 20 – first 20 will be considered out of your solution, What are the items that fall under e waste ., a. Mobile phones, b. Acid Batteries, c. All of above, d. None of these, , 27., , Assertion: ( A) Cyber stalking is a kind of Online harassment wherein the victim is subjected to a, barrage of online messages and emails., Reason: (R) Stalkers keep on sending repeated e-mails asking for various kinds of favors or, threaten the victim., 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., e) Both A and B are false, , 28., , Assertion: ( A) Phishing is the practice of attempting to acquire sensitive information from, individuals over the internet,by means of deception., Reason: ( R) It is a criminal offense., a) Both A and R are true and R is the correct explanation of A.
Page 23 :
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., e) Both A and B are false., 29., , 30., , 31., , 32., , 33., , 34., , 35., , To prevent unauthorized access to and / or from the network, a system, known as__________ , can be implemented by hardware and / or software., i.Firewall, ii.antivirus, iii.Cookies., iv.Text files, Ambika found a crumpled paper under her desk. She picked it up and opened it. It contained some, text which was struck off thrice. But she could still figure out easily that the struck off text was the, email ID and password of Garvit, her classmate. What is ethically correct for Ambika to do?, i) Inform Garvit so that he may change his password., ii) Give the password of Garvit‟s email ID to all other classmates., iii) Use Garvit‟s password to access his account., iv) None of the above, Ms. Anuradha wants to add a new column, „Total‟, where she wants the total of corresponding total, of UT1, UT2, UT3, UT4 for each students. Write an appropriate command for the purpose., a. df['Total']= df['UT1'] + df['UT2'] + df['UT3'] + df['UT4'], b. df.‟Total‟= df.‟UT1‟ + df .'UT2' + df.'UT3‟ + df.'UT4', c. df.‟Total‟ = df.sum(df[0:4]), d. df[‟Total] = df.sum(df[0:4]), Sending mean texts, posting false information about a person online, or sharing embarrassing, photos or videos to harass, threaten or humiliate a target person, is called ____________., i.Eavesdropping, ii.Cyberbullying, iii.Spamming, iv.Phishing, A trail of information that people leave online or using communication devices is referred to as:, i) Digilocker, ii) Digital Remarks, iii) Digital Footprints, iv) Digital Traces, I can keep you signed in. I can remember your site preferences. I can give you locally relevant, content. Who am I?, i) Cookies, ii) Trails, iii) History, iv) Ghost, _______ is a person who deliberately sows discord on the Internet by starting quarrels or upsetting, people, by posting inflammatory or off topic messages in an online community., a. Netizen, b. Digital Citizen, c. Internet troll, d. None of the above
Page 24 :
36., , Which method is used to plot histogram in pyplot?, A. his(), B. hist(), C. Hist(), D.histogram(), 37., Which method is used to save the output of pyplot in the form of image file ?, A. savefig(„filename‟), B. save_fig(„filename), C. save_figure(„filename‟), D. save_img(„filename‟), 38., What is true about Data Visualization ?, A. Data Visualization is used to communicate information clearly and efficiently to users by the, usage of information graphics such as tables and charts., B. Data Visualization helps users in analyzing a large amount of data in a simpler way., C. Data Visualization makes complex data more accessible, understandable, and usable., D. All of the above, Refer Anisha is a commerce teacher and working to analyze student‟s data. She has create a dataframe, For, dfm as given below. Help her by answering the questions that follows:, 39 to, 47, DataFRame dfm, , 39., , 40., , 41., , 42., , 43., , Which of the following will be used to show the details of ACC column only:, i. dfm.acc, ii. dfm.ACC, iii. dfm[„acc‟], iv. all of these, Which of the following will be used to show the details of DAVID only :, i. dfm.iloc[3], ii. dfm.iloc[4], iii. dfm.iloc[„DAVID‟], iv. All of these, Which of the following will be used to show the marks of Amit in IP:, i. dfm.IP['AMIT'], ii. dfm[4,[„IP‟]], iii. dfm["IP"]["AMIT"], iv. i and iii, Which of the following will be used to show the columns of IP and BST only where IP is first, and then BST is second column:, i. dfm.iloc[:,3:1:-1], ii. dfm.iloc[:,3:1:-2], iii. dfm.iloc[:,3:0:-1], iv. dfm.iloc[:,3:0:-2], If the rows of ROHINI, AVIKA, DAVID are to be shown along with all subject columns where, the order of Rows should be ROHINI, AVIKA and DAVID what should be the statement out of, the following:
Page 25 :
i. dfm.loc["ROHINI":"RICHA":-2], ii. dfm.loc["ROHINI":"DAVID":-3], iii. dfm.loc["ROHINI":"RICHA":-3], iv. dfm.loc["ROHINI":"MANISH":-2], 44., , Which of the following statement will be used to show the details of ENG, BST and ECO, columns., i. dfm.iloc[:,'ENG','BST','ECO'], ii. dfm.iloc[:,0,1,4], iii. dfm.iloc[:,[0,1,4]], iv. dfm.iloc[:,1,2,5], , 45., , She wants to add on more record of DIVYA with score 92 in Economics, 63 in Accountancy, 76, in English, 83 in IP and 88 in BST. Suggest her which of the following statement will be used:, i. dfm.append["DIVYA"] = [76,88,63,83,92], ii. dfm.loc["DIVYA"] = [76,88,63,83,92], iii. dfm.append(“DIVYA”, [76,88,63,83,92]), iv. dfm.append( [76,88,63,83,92],”DIVYA”), She wants to add the marks of Physical education also in the dataframe as another column PE,, these are 78,58,63,95,67,83,94,92,77,68 respectively. Suggest her which of the following, statement will be used., i. dfm.loc[:,"PE"]=[78,58,63,95,67,83,94,92,77,68 ], ii. dfm[“PE”]= [78,58,63,95,67,83,94,92,77,68 ], iii. dfm.addcol(“PE”, [78,58,63,95,67,83,94,92,77,68 ]), iv. i and ii, , 46., , 47., , She found later after creating dataframe that she has put marks wrongly in subjects BST &, Accountancy, to manage with mistake she wants to rename the columns of BST as ACC and, ACC as BST. Which statement should she use out of following:, i. dfm.rename(columns={'BST':'ACC','ACC':'BST'}), ii. dfm.rename(columns={'BST':'ACC','ACC':'BST'}, inplace=True), iii. dfm.rename(columns={'BST':'ACC','ACC':'BST'}, inplace=False), iv. dfm.rename(columns={'BST':'ACC','ACC':'BST'}, inplace=”True”), , 48., , (A) Assertion: del statement is used to remove a column from the Dataframe., (R) Reason : drop method is used to remove one or more rows and/or columns from the, dataframe., i. Both A and R are correct but R is not correct explanation of A, ii. Both A and R are correct and R is correct explanation of A, iii. R is correct but A is incorrect, iv. A is correct but R is Incorrect, , 49., , 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 E. Both A and R are false, Which of the following are not true?, A. If we do not explicitly specify an index for the data values while creating a series of N data, elements,by default indices range from 0 through N., B. We cannot assign user-defined labels to the index and use them to access elements of a Series, C. We can create a series with numeric index in random order., a. A only, b. A, B, , 50.
Page 26 : c. B, C, d. C only, SECTION C- SOLVE ALL QUESTIONS, Refer Consider this Dataframe from all questions given below, for, Name, City, Email, 51 to 0, Aksh, Ahmedabad
[email protected], 55, 1, Bhavin, Baroda,
[email protected], 2, Charu, Surat,
[email protected], 3, Dhara, Anand,
[email protected], 51., , 52., , 53., , 54., , 55., , Fees, 15000, 25000, 12000, 11000, , Choose the correct function to rename city columns to location using rename() function:, a. df.rename(columns={„City‟:‟Location‟}), b. df.rename(columns={„City‟=‟Location‟}), c. df.rename(„City‟=‟Location‟), d. df.rename(df.columns(„City‟,‟Location‟)), Which of the following statement(s) is/are correct with respect to df.columns properties to, rename columns, 1. All columns must be specified, 2. Columns must be in the form of a list, 3. Old column names not required, 4. Columns can be specified with columns number, i. Only 1 is correct, ii. 1, 2 and 3 are correct, iii. 1 and 3 are correct, iv. All of them are correct, df.index properties can be used to, i. rename rows, ii. rename columns, iii. rename rows and columns both, iv. None of these, To display 2 rows from the top in the dataframe, which of the following statement is correct:, i. df.head()=2, ii. df.head(2), iii. df.head(range(2)), iv. All of the above, Delete the name and fees columns, a) student.drop([„name‟,‟fees‟]), b) studet.delete(([„name‟,‟fees‟]), c) student.erase([„name‟,‟fees‟]), d) deletion of column is not permitted in dataframe
Page 28 :
KENDRIYA VIDYALAYA SANGATHAN, RANCHI REGION, Pre Term – I (Session 2021-22), Subject: Informatics Practices (Code-065), , 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, , 2, , 3, , The command to show the key values of a graph in python is, a), , title, , b), , legend, , c), , label, , d), , None, , Which of the following is not valid in terms of a DataFrame?, a), , It’s a part of Pandas, , b), , We can create 2 dimensional structure, , c), , User can define index of his choice, , d), , We cannot change the index once created, , If we use tail function in a DataFrame then by default ____ number of rows are, displayed., , 4, , a), , 3, , b), , 4, , c), , 5, , d), , None, , The command used to create an empty Series, a), , S=pd.Series(), , b), , S=pd.Series(np.NaN), , c), , S=pd.Series(empty), , d), , None of these, , Info.Prac./KVSRanchi/QP Set-1, 1, , Page No.
Page 29 :
5, , 6, , 7, , In a Series, to know about the dimensions (number of axis), we use, a), , <objectname>.ndim, , b), , <objectname>.dim, , c), , <objectname>.nsize, , d), , <objectname>.nbytes, , Identify the code to put the values along with missing values in a series, a), , Obj=pd.Series([7.2,NaN,7.3]), , b), , Obj=pd.Series([7.2,np.NaN,7.3]), , c), , Obj=pd.Series([7.2,NULL,7.3]), , d), , Obj=pd.Series([7.2,NaN.np,7.3]), , Using Python Matplotlib, out of the following which can be used to count how many, values fall into each interval, , 8, , 9, , 10, , 11, , a), , Line plot, , b), , Bar graph, , c), , Histogram, , d), , Charts, , Which of the following is not a valid plotting function in pyplot?, a), , bar(), , b), , hist(), , c), , histh(), , d), , barh(), , Which of the following functions is used to check the number of rows in a DataFrame?, a), , print(length(df)), , b), , print(length.df), , c), , print(len(df)), , d), , print(length[df]), , __________ command is used to display a graph in the output window, a), , plt.title(), , b), , plt.xlabel(), , c), , plt.show(), , d), , plt.plot(), , The, , is the Digital trail of your activity on the internet., , a), b), c), , Copy Left, Digital Footprint, Digital Data, , Info.Prac./KVSRanchi/QP Set-1, 2, , Page No.
Page 30 :
12, , d), Internet Property, What is meant by the term cybercrime?, a), , Any crime that uses computers to jeopardize or attempt to jeopardize national, security, , 13, , 14, , 15, , 16, , b), , The use of computer networks to commit financial or identity fraud, , c), , The theft of Digital information, , d), , Any crime that involves computers and networks, , OSS stands for, a), , Open system security, , b), , Open system source, , c), , Open software and security, , d), , Open source software, , The Library imported to insert NaN values in a DataFrame is, a), , pandas, , b), , numpy, , c), , matplotlib, , d), , math, , Which of the following is NOT an intellectual property?, a), , A poem written by a poet, , b), , An original painting made by a painter, , c), , Trademark of a Company, , d), , A remixed song, , An act of stealing others Intellectual Property without their consent of without citing the, source is called., , 17, , a), , Plagiarism, , b), , Hacking, , c), , Phishing, , d), , Bullying, , 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), , Key Error, , b), , Syntax Error, , c), , Name Error, , d), , Runtime Error, , Info.Prac./KVSRanchi/QP Set-1, 3, , Page No.
Page 31 :
18, , 19, , 20, , The correct command to add a new column “Bio” in the following DataFrame DF is, Name, , Phy, , Chem, , 0, , Manpreet, , 70, , 30, , 1, , Kavil, , 60, , 70, , 2, , Manu, , 76, , 50, , a), , DF.’Bio’=[87,59,44], , b), , DF[‘Bio’]=[87,59,44], , c), , DF.‘Bio’[87,59,44], , d), , DF.‘Bio’(87,59,44), , Which method is used to access vertical subset of a DataFrame?, a), , iterrows(), , b), , iteritems(), , c), , itertuples(), , d), , itercols(), , Which of the following command is correct to add a new index in the following, DataFrame, , 21, , Name, , Phy, , Chem, , 0, , Manpreet, , 70, , 30, , 1, , Kavil, , 60, , 70, , 2, , Manu, , 76, , 50, , 3, , Ria, , 89, , 65, , a), , df.rename((0:'A',1:'B',2:'C',3:'D')), , b), , df.rename([0:'A',1:'B',2:'C',3:'D']), , c), , df.rename[{0:'A',1:'B',2:'C',3:'D'}], , d), , df.rename({0:'A',1:'B',2:'C',3:'D'}), , After practicals, Atharv left the computer laboratory but forgot to sign off from his email, account. Later, his classmate Revaan started using the same computer. He is now logged, in as Atharv. He sends inflammatory email messages to few of his classmates using, Atharv’s email account. Revaan’s activity is an example of which of the following cyber, crime?, a), , Hacking, , b), , Identity Theft, , c), , Cyber Bullying, , Info.Prac./KVSRanchi/QP Set-1, 4, , Page No.
Page 32 :
d), 22, , 23, , Plagiarism, , The IT Act was promulgated in the year ___________, a), , 1999, , b), , 2000, , c), , 2001, , d), , 2002, , If a Dataframe is created using a 2D dictionary, then the indexes/row labels are formed, from, , 24, , 25, , a), , dictionary's values, , b), , inner dictionary's keys, , c), , outer dictionary's keys, , d), , none of these, , Which argument do you specify with read_csv( ) to specify a separator character ?, a), , character, , b), , char, , c), , separator, , d), , sep, , Which among the following options can be used to create a DataFrame in Pandas?, a), , A scalar value, , b), , An ndarray, , c), , A python dict, , d), , All of these, Section B, Section B consist of 24 Questions (26-49). Attempt any 20 questions, , 26, , Write the output of the following code., import pandas as pd, import numpy as np, data = np.array(['a', 'b', 'c', 'd', 'e']), s = pd.Series(data), print(s[3]), a), , e, , b), , d, , c), , b, , d), , c, , Info.Prac./KVSRanchi/QP Set-1, 5, , Page No.
Page 33 :
27, , Consider a Series created using following statements, import pandas as pd, import numpy as np, sl = pd.Series([3,4,7,8,4,1,2,8,9,7],index=range(10,21)), which statement will be used to get the output as 10, , 28, , a), , print(sl.index), , b), , print(sl.size), , c), , print(sl.values), , d), , print(s1), , Ritika 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), , 29, , c), , df=pd.DataFrame([Name,Phy,Chem],columns=['Name',"Phy","Chem","Total"]), , d), , d. df=pd.DataFrame({Name:"Name", Phy :"Phy",Chem: "Chem"}), , Online posting of rumours, giving threats online, posting the victim’s personal, information, comments aimed to publicly ridicule a victim is termed as, a), , Cyber Bullying, , b), , Cyber Crime, , c), , Cyber Insult, , d), , All of the Above, , Info.Prac./KVSRanchi/QP Set-1, 6, , Page No.
Page 35 :
31, , Read the statements given below and identify the right option to draw a histogram., Statement A: To make a Histogram with Matplotlib, we can use the plt.hist() function., Statement B: The bin parameter is compulsory to create histogram., , 32, , a), , Statement A is correct, , b), , Statement B is correct, , c), , Statement A is correct, but Statement B is incorrect, , d), , d. Statement A is incorrect, but Statement B is correct, , Arnav wants to add a new record to the following DataFrame df. The correct command to, do so is ___________, , 33, , Name, , Phy, , Chem, , 0, , Manpreet, , 70, , 30, , 1, , Kavil, , 60, , 70, , 2, , Manu, , 76, , 50, , a), , df.loc[3]=['Atul',68,79], , b), , df.loc(3)=['Atul',68,79], , c), , df[3]=['Atul',68,79], , d), , df.loc[3]={'Atul',68,79}, , Raghav is confused about buying Propriety operating system available in the market., Help him in choosing Propriety operating system for his device:, , 34, , a), , Ubuntu, , b), , Windows, , c), , Mozilla Firefox, , d), , Blender, , Given below there are two statements marked as Assertion (A) and Reason (R) ., Read the statements and choose the correct option., Assertion (A): Someone has created a fake social media profile in the name of Saket., Saket is a victim of cyberstalking., Reason (R): Cyberstalking is a form of cybercrime., 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., , Info.Prac./KVSRanchi/QP Set-1, 8, , Page No.
Page 36 :
35, , What will be the output of the following program:, import pandas as pd, s = pd.Series([1,2,3,4,5],index=['a','b','c','d','e']), print(s[::-4]), , a), , e, , 5, , a, , 1, , dtype: int64, b), , a, , 1, , e, , 5, , dtype: int64, c), , a, , 1, , d, , 4, , dtype: int64, d), , e, , 5, , b, , 2, , dtype: int64, 36, , Ankita received an SMS, from her bank querying a recent transaction asking her pin, number. Answer the following questions as what she should do upon receiving the SMS:, i. She should not SMS her pin number to the given contact number, ii. She should call the bank helpline number to recheck the validity of the SMS, received?, iii. She should SMS her pin number to the given contact number, iv. She should not call the bank helpline number to recheck the validity of the SMS, received?, , 37, , a), , Only (i), , b), , Both (i) and (ii), , c), , Only (ii), , d), , Both (iii) and (iv), , Which of the following command will display the column labels of the DataFrame?, (a), , print(df.columns()), , (b), , print(df.column()), , Info.Prac./KVSRanchi/QP Set-1, 9, , Page No.
Page 37 :
38, , 39, , (c), , print(df.column), , (d), , print(df.columns), , Which of the following constitute e-waste?, (a), , Discarded computers, , (b), , Damaged printers, , (c), , Useless CDs, , (d), , All of the above, , Difference between loc() and iloc().:, a. Both are Label indexed based functions., b. Both are Integer position-based functions., c. loc() is label based function and iloc() integer position based function., d. loc() is integer position based function and iloc() index position based function., , 40, , Write the output of the given program:, import pandas as pd, S1=pd.Series({‘Indore’:20,’Ujjain’:35,’Bhopal’:40}), print(S1[S1>20]), (a), , Ujjain, Bhopal, , 35, 40, , dtype: int64, (b), , Series([], dtype: int64), , (c), , Indore, , 20, , Ujjain, , 35, , Bhopal, , 40, , dtype: int64, (d), , Indore, , 20, , dtype: int64, 41, , 42, , Being a responsible digital citizen, we should ______, a., , not use copyrighted materials, , b., , avoid cyber bullying, , c., , respect privacy of others, , d., , All of the above, , Consider the pandas Series, S=pd.Series([10,20,30,40,50], index=[0,1,2,3,4]), the output, of command S.iloc[1:3] will include, a), , Will produce error, , b), , Will include values 10,20 30 in result, , Info.Prac./KVSRanchi/QP Set-1, 10, , Page No.
Page 38 :
43, , c), , will include values 10,20 in result, , d), , will include values 20,30 in result, , Which command will be used to delete 3 and 5 rows of the DataFrame. Assuming the, DataFrame name is DF., , 44, , Name, , Phy, , Chem, , 0, , Manpreet, , 70, , 30, , 1, , Kavil, , 60, , 70, , 2, , Manu, , 76, , 50, , 3, , Ria, , 89, , 65, , 4, , Anu, , 78, , 56, , 5 Appu, , 54, , 82, , a), , DF.drop([2,4],axis=0), , b), , DF.drop([2,4],axis=1), , c), , DF.drop([3,5],axis=1), , d), , DF.drop([3,5]), , Write the output of the given command:, import pandas as pd, s=pd.Series([1,2,3,4,5,6],index=['A','B','C','D','E','F']), print(s[s//2==0]), , a), , B, , 2, , dtype: int64, b), , A, , 1, , dtype: int64, c), , C, , 3, , dtype: int64, d), , E, , 5, , dtype: int64, , Info.Prac./KVSRanchi/QP Set-1, 11, , Page No.
Page 39 :
45, , Anil has the following DataFrame at his disposal. He wants to convert it to a CSV file, “abc.csv”. The command will be, , 46, , Name, , Phy, , Chem, , 0, , Manpreet, , 70, , 30, , 1, , Kavil, , 60, , 70, , 2, , Manu, , 76, , 50, , 3, , Ria, , 89, , 65, , a), , df.to_csv("abc.csv"), , b), , df.to_csv("abc.csv",header=None), , c), , both a and b are correct, , d), , None of a and b are correct, , If a DataFrame df has 4 rows and 5 columns, then print(df.shape) will display, a) [4,5], b) 4,5, c) (4,5), d) 4,5, , 47, , Which of the following operations will produce a DataFrame df with rows and columns, interchanged as depicted below?, , Original DataFrame, fruit, , price, , 0, , orange 200, , 1, , apple, , 250, , Altered DataFrame, 0, fruit, , 1, , orange apple, , Info.Prac./KVSRanchi/QP Set-1, 12, , Page No.
Page 41 :
Reason(R) Pandas used three data structures for data analysis and manipulation names, as Series, Data Frame and Panel, 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 false but R is true, , d), , A is true but R is false, , Section C, Section C consists of 6 Questions(50-55), Attempts any 5 questions, Mr. Ankit is working in an organisation as data analyst. He uses Python Pandas and, Matplotlib for the same. He got a dataset of the passengers for the year 2010 to 2012 for, January, March and December. His manager wants certain information from him, but he, is facing some problems. Help him by answering few questions given below:, , Code to create the above data frame:, import pandas as ____________ #Statement 1, data={"Year":[2010,2010,2012,2010,2012],"Month":["Jan","Mar","Jan","Dec","Dec", ],"Passengers":[25,50,35,55,65]}, df=pd.____________________(data) #Statement 2, print(df), 50, , 51, , Choose the right code from the following for statement 1., a), , pd, , b), , df, , c), , data, , d), , p, , Choose the right code from the following for the statement 2., a), , Dataframe, , Info.Prac./KVSRanchi/QP Set-1, 14, , Page No.
Page 42 :
52, , b), , DataFrame, , c), , Series, , d), , Dictionary, , Choose the correct statement/ method for the required output:, (5,3), , 53, , a), , df.index, , b), , df.shape(), , c), , df.shape, , d), , df.size, , He wants to print the details of "January" month along with the number of passengers,, Identify the correct statement:, , 54, , a), , df.loc[['Month','Passengers']][df['Month']=='Jan'], , b), , df[['Month','Passengers']][df['Month']=='Jan'], , c), , df.iloc[['Month','Passengers']][df['Month']=='Jan'], , d), , df(['Month','Passengers']][df['Month']=='Jan'), , Mr. Ankit wants to change the index of the Data Frame and the output for the same is, given below. Identify the correct statement to change the index., , 55, , a), , df.index[]=["Air India","Indigo","Spicejet","Jet","Emirates"], , b), , df.index["Air India","Indigo","Spicejet","Jet","Emirates"], , c), , df.index=["Air India","Indigo","Spicejet","Jet","Emirates"], , d), , df.index()=["Air India","Indigo","Spicejet","Jet","Emirates"], , Consider the DataFrame given and write the output of the given command, , Info.Prac./KVSRanchi/QP Set-1, 15, , Page No.
Page 43 :
print(df.loc[:0,'Month']), a), , 0 Jan, , b), , 1 March, , c), , 2 Jan, , d), , 0 Jan, , Info.Prac./KVSRanchi/QP Set-1, 16, , Page No.
Page 44 :
KENDRIYA VIDYALAYA SANGATHAN, RANCHI REGION, Pre Term – I (Session 2021-22), Subject: Informatics Practices (Code-065), , Class–XII, , Time Allowed : 90 minutes, , Maximum Marks: 35, , MARKING SCHEME, 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, , 2, , 3, , The command to show the key values of a graph in python is, a), , title, , b), , legend, , c), , label, , d), , None, , Which of the following is not valid in terms of a DataFrame?, a), , It’s a part of Pandas, , b), , We can create 2 dimensional structure, , c), , User can define index of his choice, , d), , We cannot change the index once created, , If we use tail function in a DataFrame then by default ____ number of rows are, displayed., , 4, , a), , 3, , b), , 4, , c), , 5, , d), , None, , The command used to create an empty Series, a), , S=pd.Series(), , b), , S=pd.Series(np.NaN), , c), , S=pd.Series(empty), , d), , None of these, 1
Page 45 :
5, , 6, , 7, , In a Series, to know about the dimensions (number of axis), we use, a), , <objectname>.ndim, , b), , <objectname>.dim, , c), , <objectname>.nsize, , d), , <objectname>.nbytes, , Identify the code to put the values along with missing values in a series, a), , Obj=pd.Series([7.2,NaN,7.3]), , b), , Obj=pd.Series([7.2,np.NaN,7.3]), , c), , Obj=pd.Series([7.2,NULL,7.3]), , d), , Obj=pd.Series([7.2,NaN.np,7.3]), , Using Python Matplotlib, out of the following which can be used to count how many, values fall into each interval, , 8, , 9, , 10, , 11, , a), , Line plot, , b), , Bar graph, , c), , Histogram, , d), , Charts, , Which of the following is not a valid plotting function in pyplot?, a), , bar(), , b), , hist(), , c), , histh(), , d), , barh(), , Which of the following functions is used to check the number of rows in a DataFrame?, a), , print(length(df)), , b), , print(length.df), , c), , print(len(df)), , d), , print(length[df]), , __________ command is used to display a graph in the output window, a), , plt.title(), , b), , plt.xlabel(), , c), , plt.show(), , d), , plt.plot(), , The, , is the Digital trail of your activity on the internet., , a), b), c), d), , Copy Left, Digital Footprint, Digital Data, Internet Property, 2
Page 46 :
12, , What is meant by the term cybercrime?, a), , Any crime that uses computers to jeopardize or attempt to jeopardize national, security, , 13, , 14, , 15, , 16, , b), , The use of computer networks to commit financial or identity fraud, , c), , The theft of Digital information, , d), , Any crime that involves computers and networks, , OSS stands for, a), , Open System Security, , b), , Open System Source, , c), , Open Software and Security, , d), , Open Source Software, , The Library imported to insert NaN values in a DataFrame is, a), , pandas, , b), , numpy, , c), , matplotlib, , d), , math, , Which of the following is NOT an intellectual property?, a), , A poem written by a poet, , b), , An original painting made by a painter, , c), , Trademark of a Company, , d), , A remixed song, , An act of stealing others Intellectual Property without their consent of without citing the, source is called., , 17, , a), , Plagiarism, , b), , Hacking, , c), , Phishing, , d), , Bullying, , 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), , Key Error, , b), , Syntax Error, , c), , Name Error, , d), , Runtime Error, , 3
Page 47 :
18, , 19, , 20, , The correct command to add a new column “Bio” in the following DataFrame DF is, Name, , Phy, , Chem, , 0, , Manpreet, , 70, , 30, , 1, , Kavil, , 60, , 70, , 2, , Manu, , 76, , 50, , a), , DF.’Bio’=[87,59,44], , b), , DF[‘Bio’]=[87,59,44], , c), , DF.‘Bio’[87,59,44], , d), , DF.‘Bio’(87,59,44), , Which method is used to access vertical subset of a DataFrame?, a), , iterrows(), , b), , iteritems(), , c), , itertuples(), , d), , itercols(), , Which of the following command is correct to add a new index in the following, DataFrame, , 21, , Name, , Phy, , Chem, , 0, , Manpreet, , 70, , 30, , 1, , Kavil, , 60, , 70, , 2, , Manu, , 76, , 50, , 3, , Ria, , 89, , 65, , a), , df.rename((0:'A',1:'B',2:'C',3:'D')), , b), , df.rename([0:'A',1:'B',2:'C',3:'D']), , c), , df.rename[{0:'A',1:'B',2:'C',3:'D'}], , d), , df.rename({0:'A',1:'B',2:'C',3:'D'}), , After practicals, Atharv left the computer laboratory but forgot to sign off from his email, account. Later, his classmate Revaan started using the same computer. He is now logged, in as Atharv. He sends inflammatory email messages to few of his classmates using, Atharv’s email account. Revaan’s activity is an example of which of the following cyber, crime?, a), , Hacking, , b), , Identity Theft, , c), , Cyber Bullying, , d), , Plagiarism, 4
Page 48 :
22, , 23, , The IT Act was promulgated in the year ___________, a), , 1999, , b), , 2000, , c), , 2001, , d), , 2002, , If a Dataframe is created using a 2D dictionary, then the indexes/row labels are formed, from, , 24, , 25, , a), , dictionary's values, , b), , inner dictionary's keys, , c), , outer dictionary's keys, , d), , none of these, , Which argument do you specify with read_csv( ) to specify a separator character ?, a), , character, , b), , char, , c), , separator, , d), , sep, , Which among the following options can be used to create a DataFrame in Pandas?, a), , A scalar value, , b), , An ndarray, , c), , A python dict, , d), , All of these, Section B, Section B consist of 24 Questions (26-49). Attempt any 20 questions, , 26, , Write the output of the following code., import pandas as pd, import numpy as np, data = np.array(['a', 'b', 'c', 'd', 'e']), s = pd.Series(data), print(s[3]), a), , e, , b), , d, , c), , b, , d), , c, , 5
Page 49 :
27, , Consider a Series created using following statements, import pandas as pd, import numpy as np, sl = pd.Series([3,4,7,8,4,1,2,8,9,7],index=range(10,20)), which statement will be used to get the output as 10, , 28, , a), , print(sl.index), , b), , print(sl.size), , c), , print(sl.values), , d), , print(s1), , Ritika 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), , 29, , c), , df=pd.DataFrame([Name,Phy,Chem],columns=['Name',"Phy","Chem","Total"]), , d), , d. df=pd.DataFrame({Name:"Name", Phy :"Phy",Chem: "Chem"}), , Online posting of rumours, giving threats online, posting the victim’s personal, information, comments aimed to publicly ridicule a victim is termed as, a), , Cyber Bullying, , b), , Cyber Crime, , c), , Cyber Insult, , d), , All of the Above, , 6
Page 51 :
31, , Read the statements given below and identify the right option to draw a histogram., Statement A: To make a Histogram with Matplotlib, we can use the plt.hist() function., Statement B: The bin parameter is compulsory to create histogram., , 32, , a), , Statement A is correct, , b), , Statement B is correct, , c), , Statement A is correct, but Statement B is incorrect, , d), , d. Statement A is incorrect, but Statement B is correct, , Arnav wants to add a new record to the following DataFrame df. The correct command to, do so is ___________, , 33, , Name, , Phy, , Chem, , 0, , Manpreet, , 70, , 30, , 1, , Kavil, , 60, , 70, , 2, , Manu, , 76, , 50, , a), , df.loc[3]=['Atul',68,79], , b), , df.loc(3)=['Atul',68,79], , c), , df[3]=['Atul',68,79], , d), , df.loc[3]={'Atul',68,79}, , Raghav is confused about buying Propriety operating system available in the market., Help him in choosing Propriety operating system for his device:, , 34, , a), , Ubuntu, , b), , Windows, , c), , Mozilla Firefox, , d), , Blender, , Given below there are two statements marked as Assertion (A) and Reason (R) ., Read the statements and choose the correct option., Assertion (A): Someone has created a fake social media profile in the name of Saket., Saket is a victim of cyberstalking., Reason (R): Cyberstalking is a form of cybercrime., 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., , 8
Page 52 :
35, , What will be the output of the following program:, import pandas as pd, s = pd.Series([1,2,3,4,5],index=['a','b','c','d','e']), print(s[::-4]), , a), , e, , 5, , a, , 1, , dtype: int64, b), , a, , 1, , e, , 5, , dtype: int64, c), , a, , 1, , d, , 4, , dtype: int64, d), , e, , 5, , b, , 2, , dtype: int64, 36, , Ankita received an SMS, from her bank querying a recent transaction asking her pin, number. Answer the following questions as what she should do upon receiving the SMS:, i. She should not SMS her pin number to the given contact number, ii. She should call the bank helpline number to recheck the validity of the SMS, received?, iii. She should SMS her pin number to the given contact number, iv. She should not call the bank helpline number to recheck the validity of the SMS, received?, , 37, , a), , Only (i), , b), , Both (i) and (ii), , c), , Only (ii), , d), , Both (iii) and (iv), , Which of the following command will display the column labels of the DataFrame?, (a), , print(df.columns()), , (b), , print(df.column()), , (c), , print(df.column), , (d), , print(df.columns), 9
Page 53 :
38, , 39, , Which of the following constitute e-waste?, (a), , Discarded computers, , (b), , Damaged printers, , (c), , Useless CDs, , (d), , All of the above, , Difference between loc() and iloc().:, a. Both are Label indexed based functions., b. Both are Integer position-based functions., c. loc() is label based function and iloc() integer position based function., d. loc() is integer position based function and iloc() index position based function., , 40, , Write the output of the given program:, import pandas as pd, S1=pd.Series({‘Indore’:20,’Ujjain’:35,’Bhopal’:40}), print(S1[S1>20]), (a), , Ujjain, Bhopal, , 35, 40, , dtype: int64, (b), , Series([], dtype: int64), , (c), , Indore, , 20, , Ujjain, , 35, , Bhopal, , 40, , dtype: int64, (d), , Indore, , 20, , dtype: int64, 41, , 42, , Being a responsible digital citizen, we should ______, a., , not use copyrighted materials, , b., , avoid cyber bullying, , c., , respect privacy of others, , d., , All of the above, , Consider the pandas Series, S=pd.Series([10,20,30,40,50], index=[0,1,2,3,4]), the output, of command S.iloc[1:3] will include, a), , Will produce error, , b), , Will include values 10,20 30 in result, , c), , will include values 10,20 in result, , d), , will include values 20,30 in result, 10
Page 54 :
43, , Which command will be used to delete 3 and 5 rows of the DataFrame. Assuming the, DataFrame name is DF., , 44, , Name, , Phy, , Chem, , 0, , Manpreet, , 70, , 30, , 1, , Kavil, , 60, , 70, , 2, , Manu, , 76, , 50, , 3, , Ria, , 89, , 65, , 4, , Anu, , 78, , 56, , 5 Appu, , 54, , 82, , a), , DF.drop([2,4],axis=0), , b), , DF.drop([2,4],axis=1), , c), , DF.drop([3,5],axis=1), , d), , DF.drop([3,5]), , Write the output of the given command:, import pandas as pd, s=pd.Series([1,2,3,4,5,6],index=['A','B','C','D','E','F']), print(s[s//2==0]), , a), , B, , 2, , dtype: int64, b), , A, , 1, , dtype: int64, c), , C, , 3, , dtype: int64, d), , E, , 5, , dtype: int64, , 11
Page 55 :
45, , Anil has the following DataFrame at his disposal. He wants to convert it to a CSV file, “abc.csv”. The command will be, , 46, , Name, , Phy, , Chem, , 0, , Manpreet, , 70, , 30, , 1, , Kavil, , 60, , 70, , 2, , Manu, , 76, , 50, , 3, , Ria, , 89, , 65, , a), , df.to_csv("abc.csv"), , b), , df.to_csv("abc.csv",header=None), , c), , both a and b are correct, , d), , None of a and b are correct, , If a DataFrame df has 4 rows and 5 columns, then print(df.shape) will display, a) [4,5], b) 4,5, c) (4,5), d) 4,5, , 47, , Which of the following operations will produce a DataFrame df with rows and columns, interchanged as depicted below?, , Original DataFrame, fruit, , price, , 0, , orange 200, , 1, , apple, , 250, , Altered DataFrame, 0, , 1, , fruit, , orange apple, , price, , 200, , 250, , a) df.ndim, 12
Page 56 :
b) df.T, c) df.axes, d) df.columns, 48, , Consider the following DataFrame name df, , Write the output of the given command:, print(df.marks/2), , a.0, , 45.0, , 1, , NaN, , 2, , 43.5, , Name:Marks,dtype:float64, b.0, , 45.0, , 1, , NaN, , 2, , 43, , Name:Marks,dtype:float64, c.0, , 45, , 1, , NaN, , 2, , 43.5, , Name:Marks,dtype:float64, d.0, , 45.0, , 1, , 0, , 2, , 43.5, , Name:Marks,dtype:float64, 49, , Assertion(A): Pandas is the external library of python which is used for data analysis and, manipulation, Reason(R) Pandas used three data structures for data analysis and manipulation names, as Series, Data Frame and Panel, 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 false but R is true, 13
Page 57 :
d), , A is true but R is false, , Section C, Section C consists of 6 Questions(50-55), Attempts any 5 questions, Mr. Ankit is working in an organisation as data analyst. He uses Python Pandas and, Matplotlib for the same. He got a dataset of the passengers for the year 2010 to 2012 for, January, March and December. His manager wants certain information from him, but he, is facing some problems. Help him by answering few questions given below:, , Code to create the above data frame:, import pandas as ____________ #Statement 1, data={"Year":[2010,2010,2012,2010,2012],"Month":["Jan","Mar","Jan","Dec","Dec", ],"Passengers":[25,50,35,55,65]}, df=pd.____________________(data) #Statement 2, print(df), 50, , 51, , 52, , Choose the right code from the following for statement 1., a), , pd, , b), , df, , c), , data, , d), , p, , Choose the right code from the following for the statement 2., a), , Dataframe, , b), , DataFrame, , c), , Series, , d), , Dictionary, , Choose the correct statement/ method for the required output:, (5,3), a), , df.index, 14
Page 58 :
53, , b), , df.shape(), , c), , df.shape, , d), , df.size, , He wants to print the details of "January" month along with the number of passengers,, Identify the correct statement:, , 54, , a), , df.loc[['Month','Passengers']][df['Month']=='Jan'], , b), , df[['Month','Passengers']][df['Month']=='Jan'], , c), , df.iloc[['Month','Passengers']][df['Month']=='Jan'], , d), , df(['Month','Passengers']][df['Month']=='Jan'), , Mr. Ankit wants to change the index of the Data Frame and the output for the same is, given below. Identify the correct statement to change the index., , 55, , a), , df.index[]=["Air India","Indigo","Spicejet","Jet","Emirates"], , b), , df.index["Air India","Indigo","Spicejet","Jet","Emirates"], , c), , df.index=["Air India","Indigo","Spicejet","Jet","Emirates"], , d), , df.index()=["Air India","Indigo","Spicejet","Jet","Emirates"], , Consider the DataFrame given and write the output of the given command, , print(df.loc[:0,'Month']), a), , 0 Jan, 15
Page 59 :
b), , 1 March, , c), , 2 Jan, , d), , 0 Jan, , 16
Page 60 :
KENDRIYA VIDYALAYA SANGATHAN MUMBAI REGION, PRE-BOARD-1 TERM-I QUESTION PAPER, Subject: Informatics Practices (Code-065), Class – XII, SET I, 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.NumPy stands for _______________, a. Number Python, b. Numerical Python, c. Numbers in Python, d. None of the above, 2.We can analyse the data in pandas with:, a. Series, b. DataFrame, c. Both of the above, d. None of the above, 1/18
Page 61 :
3.Which of the following input can be accepted by DataFrame?, a. Structured ndarray, b. Series, c. DataFrame, d. All of the above, 4. To get the number of elements in a series object,___________ attribute may be used., a. index, b. size, c. itemsize, d. ndim, 5. Write the command to extract the complete row ‘T03’., a. df.loc[:,’ID’], b. df.loc[‘T03’,’Name’], c. df.loc[‘T02’,’T03’], d. df.loc[‘T03’,:], 6. To delete a column from a DataFrame, you may use statement., a. remove, b. del, c. drop, d. cancel statement, 7. To get top 5 rows of a dataframe, you may use, a. head(), b. top(), c. tail(), , 2/18
Page 62 :
d. None of the above, 8. To specify the style of line as dashed , which argument of plot() needs to be set ?, a. line, b. width, c. style, d. linestyle, 9. A ___________ is a summarisation tool for discrete or continuous data., a. quartile, b. histogram, c. mean, d. median, 10. Which of the following is not a valid plotting function of pyplot ?, a. plot(), b. bar(), c. line(), d. pie(), 11. Our digital footprints are stored in local web browser in the form of ________, a. browsing history, b. cookies, c. passwords, d. All of the above, 12. Which of the following is not a cyber crime?, a. Phishing, b. Ransomware, , 3/18
Page 63 :
c. Hacking, d. Tracking, 13. Which of the following is an advantage of ‘proprietary ‘ software?, a. It is usually free, b. Thoroughly tested because people are paying to use it, c. Not as customizable, d. Can sometimes be too generic for specialist purpose, 14. To specify datatype int16 for a Series object, you can write :, a. pd.Series(data = array, dtype = int16), b. pd.Series(data = array, dtype = numpy.int16), c. pd.Series(data = array.dtype pandas.int16), d. all of the above, 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 Reserve, c. Intellectual Property Rights, d. Intellectual Product Rights, 16. E-waste stands for ______, a. Electrical waste, b. Electronic waste, c. Electricity waste, d. E-waste, 17. Which of the following is missing data?, , 4/18
Page 64 :
a. NULL, b. NaN, c. None, d. All of the above, 18. 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, 19. To change the 5th column's value at 3rd row as 35 in dataframe DF, you can write, a. DF[4, 6] = 35, b. DF.iat[4, 6] = 35, c. DF[3, 5] = 35, d. DF.iat[3, 5] = 35, 20. The process of re-selling old electronics goods at lower prices is called __________, a. refurbishing, b. recycle, c. reuse, d. reduce, 21. Unsolicited commercial email is known as:, a. Malware, b. virus, c. spam, d. Spyware, , 5/18
Page 65 :
22. After practicals, Atharv left the computer laboratory but forgot to sign off from his email, account. Later his classmate Revaan started using the same computer. He sends inflammatory, email messages to few of his classmates using Atharvs email account. Revaan activity is an, example of which of the following cybercrime?, a. Hacking, b. Identity theft, c. Cyber bullying, d. Plagiarism, 23. All Pandas' data structures are mutable but not always mutable., a. size, value, b. semantic, size, c. value, size, d. none of these, 24. Which argument do you specify with read_csv( ) to specify a separator character ?, a. character, b. char, c. separator, d. sep, 25. To get the transpose of a dataframe D1,you can write____________, a. D1.T, b. D1.Transpose, c. D1.Swap, d. All of these, , 6/18
Page 66 :
Section – B, Section B consists of 24 Questions (26 to 49). Attempt any 20 questions., 26. How many values will be there in array1, if given code is not returning any error ?, >>>s4=pd.Series(array1,index=[‘Jan’,’Feb’,’Mar’,’Apr’], a. 1, b. 2, c. 3, d. 4, 27. Which of the following code will generate the following output?, Jan 31, Feb 28, Mar 31, dtype: int64, , a., import pandas as pd, S1 = pd.Series(data = [31,28,31], index=["Jan","Feb","Mar"]), print(S1), b., import pandas as pd, S1 = pd.Series([31,28,31], index=["Jan","Feb","Mar"]), print(S1), c. both of the above, d. None of the above, 28. Write the statement to get NewDelhi as output using positional index, import pandas as pd, S1 = pd.Series(['NewDelhi', 'WashingtonDC', 'London', 'Paris'],, index=['India', 'USA', 'UK', 'France']), a. print(S1[0]), b. print(S1[‘India’]), 7/18
Page 67 :
c. Both of the above, d. print(S1.India), 29. Online posting of rumours , giving threats online, posting the victim’s personal information, , comments aimed to publicly ridicule a victim is termed as ________, a. Cyber bullying, b. Cyber crime, c. Cyber insult, d. All of the above, 30. Look at the following graph and select appropriate code to obtain this output. (assume that, pandas and matplotlib is already imported), , 8/18
Page 68 :
31. Read the statements given below and identify the right option to draw a histogram., Statement A: The bar chart has categories of data whereas histogram has number of, ranges., Statement B: The bars of bar-chart have gaps in between but the bins (bars) of, histogram have no gaps as number ranges are continuous, a. Statement A is correct, b. Statement B is correct, c. Statement A is correct, but Statement B is incorrect, d. Statement A and Statement B both are correct, 32. Which argument in hist() is used to create a stacked bar type histogram?, a. histt, b. histtype, c. type, d. barstacked, 33. Which of the following is not an operating system?, a. UNIX, b. MS-DOS, c. CP/M, 9/18
Page 69 :
d. PASCAL, 34. What is included in an E-mail address?, Statement 1: Domain name followed by user’s name, Statement 2: User’s name followed by domain name, Statement 3: User’s name followed by postal address, Statement 4: User’s name followed by host name, a. Statements 1 and 2., b. Statements 2 and 3., c. Statements 3 and 4., d. Statements 2 and 4., 35. Consider the following series S3, 0, , 23, , 1, , 20, , 2, , 50, , 3, , 70, , 4, , 35, , dtype: int32, Identify the correct command for the following output:, 2, , 50, , 3, , 70, , 4, , 35, , dtype: int32, a. S3.iloc[2:5], b. S3.iloc[2:4], c. S3.iloc[1:4], 10/18
Page 70 :
d. S3.iloc[:], 36. Rishika found a crumpled paper under her desk.She picked it up and opened it., It contained some text which was struck off thrice. But she could still figure out, easily that the struck off text was the email ID and password of Garvit, her, classmate. What is ethically correct for Rishita to do?, a.Inform Garvit so that he may change his password, b. Give the password of Garvit’s email ID to all other classmates, c. Use Garvit’s password to access his account, d. None of the above, 37. In given code dataframe ‘D1’ has ________ rows and ______ columns., import pandas as pd, LoD = [{‘a’:10, ‘b’:20}, {‘a’:5, ‘b’:10, ‘c’:20}, {‘a’:7, ‘d’:10, ‘e’:20}], D1 = pd.DataFrame(LoD), a. 3, 3, b. 3, 4, c. 3, 5, d. None of the above, 38. Which of the following is not the correct method of E-waste management?, a. Regrow, b. Reduce, c. Recycle, d. Reuse, 39. Difference between at() and iat().:, a. Both are Label indexed based functions., b. Both are Integer position-based functions., c. at() is label based function and iat() integer position based function., d. at() is integer position based function and iat() index position based function., 40. Write the output of the given program:, import pandas as pd, 11/18
Page 73 :
dtype: int64, d.None of the above, 44. Ritika 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'], mrks=[70,60,76,89], a. df=pd.DataFrame({"Name":Name,"Marks":mrks }), b. d=("Name":Name,"Marks":mrks), c. df=pd.DataFrame([Name,mrks],columns=['Name'," mrks"]), d. df=pd.DataFrame({Name:"Name", Marks:mrks }), 45. Which of the following is not an example of Social media platform?, a. Facebook, b. Pinterest, c. Google+, d. Social channel, 46. Assuming the given structure, which command will give us the given output:, , Output Required: 16, a. print(df.shape()), b. print(df.shape), c. print(df.size), d. print(df.size()), 14/18
Page 74 :
47. Write the output of the given command:, , df1.iloc[1:2,1:3], , a. OUTPUT, Total, Amit, , 350.5, , Percentage, 70, , b. OUTPUT, Total, Bimal, , 400.0, , Percentage, 80, , c. OUTPUT, Total, Bimal, , 350.5, , Percentage, 80, , d. None of the above, 48. Consider the following data frame name df, , 15/18
Page 75 :
Write the output of the given command:, print(df.marks+2), a. 0, , 92.0, , 1, , NaN, , 2, , 89.0, , Name: Marks,, b. 0, , 45.0, , 1, , NaN, , 2, , 43, , dtype: float64, , Name: Marks, dtype: float64, c. 0, , 45, , 1, , NaN, , 2, , 43.5, , Name: Marks, dtype: float64, d. None of the above, 49.Statement (A): In Python, Exclusive libraries can be used for graphical or visual, representation of information and data using elements like charts, graphs and maps etc., Statement (B): Matplotlib is a python package for 2D plotting that generates production, quality graphs., a. Statement A is correct., b. Statement B is correct., c. Statement A is correct, but Statement B is incorrect., d. Both Statement A and B is correct., , 16/18
Page 76 :
Section – C, Section C, consists of 6 Question (50 to 55). Attempt any 5 questions., Case Study, 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. Sha has, created a data frame ‘df’ to keep track of the number of first, second and third prize won by, different houses in the various events., , Write Python commands to do the following:, 50. Display the house names where the number of second prizes are in the range of 12 to 20., a. df[‘House’][(df[‘Second’]>12) or (df[‘Second’]<=20)], b. df[House][(df[‘Second’]>12) and (df[‘Second’]<=20)], c. df[‘House’][(df[‘Second’]>12) & (df[‘Second’]<=20)], d. df[(df[‘Second’]>12) & (df[‘Second’]<=20)], 51. To display the records in reverse order the command would be?, a. print(df[::1]), b. print(df.iloc[::-1]), c. print(df[[-1:]+df[:-1], d. print(df.reverse()), 52. Write python command to display bottom 3 records., 17/18
Page 77 :
a. df.last(3), b. df.bottom(3), c. df.next(3), d. df.tail(3), 53. Choose the correct output of the given statements., x=df.columns[:1], print(x), a. 0, b. House, c. First, d. Error, 54. Which command will give the output (6,4)?, a. print(df.size), b. print(df.shape), c. print(df.index), d. print(df.axes), 55. What is the output of the following Python statement?, df.iloc[1:2,1:2], a. Ganges, b. 10, c. 8, d. Jamuna, ****************************************End*********************************************, , 18/18
Page 78 :
KENDRIYA VIDYALAYA SANGATHAN MUMBAI REGION, PRE-BOARD-1 TERM-I, Subject: Informatics Practices (Code-065), Class – XII, MARKING SCHEME (SET I), Time Allowed: 90 minutes, , Maximum Marks: 35, , 1. b. Numerical Python, 2. c. Both of the above, 3. d. All of the above, 4. b. size, 5. d. df.loc[‘T03’,:], 6. b. del, 7. a. head(), 8. d. linestyle, 9. b. histogram, 10. c. line(), 11. d. All of the above, 12. d. Tracking, 13. b. Thoroughly tested because people are paying to use it, 14. b. pd.Series(data = array, dtype = numpy.int16), 15. c. Intellectual Property Rights, 16. b. Electronic waste, 17. d. All of the above, 18. d. forever, 19. d. DF.iat[3, 5] = 35, 20. a. refurbishing, 21. c. spam, 22. b. Identity theft, 23. c. value, size, 24. d. sep, 25. a. D1.T
Page 79 :
26. d. 4, 27. c. both of the above, 28. a. print(S1[0]), 29. a. Cyber bullying, 30. d., 31. d. Statement A and Statement B both are correct, 32. b. histtype, 33. d. PASCAL, 34. d. Statements 2 and 4., 35. a. S3.iloc[2:5], 36. a. Inform Garvit so that he may change his password, 37. c. 3, 5, 38. a. Regrow, 39. c. at() is label based function and iat() integer position based function., 40. a., 41. d. All of the above, 42. a. df=df.drop(['R1','R2'],1), 43. c., 44. a. df=pd.DataFrame({"Name":Name,"Marks":mrks }), 45. d. Social channel, 46. c. print(df.size), 47. b., 48. a., 49. d. Both Statement A and B is correct., 50. c. df[‘House’][(df[‘Second’]>12) & (df[‘Second’]<=20)], 51. b. print(df.iloc[::-1]), 52. d. df.tail(3), 53. b. House, 54. print(df.shape), 55. b.10, ************************************************************************************************
Page 80 :
KENDRIYA VIDYALAYA SANGATHAN KOLKATA REGION, PRE-BOARD EXAMINATION (TERM-1), SESSION-2021-22, , CLASS:XII, SUBJECT-INFORMATICS PRACTICES (065), , 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., , Which of the following are modules/libraries in Python?, a., b., c., d., , 2., , NumPy, Pandas, Matplotlib, All of the above, , __________ is an important library used for analyzing data., a., b., c., d., , Math, Random, Pandas, None of the above, , 3., , The command to install the matplotlib is:, , 4., , a. install pip matplotlib, b. install matplotlib, c. pip matplotlib, d. pip install matplotlib, The ndim for a Series will give:, a., b., c., d., , 5., , 0, 1, 3, 2, , Python was developed by:, a. Guido van Rossum, b. Travis Oliphant
Page 81 :
c. Wes McKinney, d. Brendan Eich, 6., , The command used to give a title along X-Axis to a graph is _________., a., b, c., d., , LabelX(), xtitle(), xlabel(), label(), , 7., , What is the minimum number of arguments required for DataFrame() function in Pandas?, , 8., , a. 1, b. 0, c. 2, d. 3, Method or function to display the first five rows in a data frame is:, a., b, c., d., , 9., , heads(), head(), xlabel(), label(), , Write the correct option for the method used in Pandas to delete columns in dataframe, a.delete(), b.drop(), c.remove(), d.pop(), , 10., , ____________ is a graphical representation of the distribution ofnumerical data by showing the, number of data points that fall within a specifiedrange of values., a.Histogram, b.Frequency Polygon, c.Bar Graph, d. None of these, , 11., , Which of the following is not an intellectual property?, a. A poem written by a poet, b. An original painting made by a painter, c. Trademark of a Company, d. A remixed song, , 12., , In this era of digital society, we can do _____________, a.Online Shopping, b. Online Banking, c. Online Education, d.All of the above, , 13., , Proprietary software is a software which is available _________, a. free of charge, b. on paying license fee, c. free for first year only, d. none of the above
Page 82 :
14., , NumPy stands for ____, a.Number Python, b. Numerical Python, c. Numbers in Python, d. None of the above., , 15., , Ravi copies some contents from Internet, but do not mention the source or the original creator., This is an act of ______, a. Plagiarism, b. Copyright Infringement, c. Trademark Infringement, d. Licence Infringement, , 16., , Bad posture of using computer may cause _____, a.Backache, b. Neck Pain, c. Shoulder pain, d. All of the above, , 17., , _____________ function is used for changing the order of rows and columns in a dataframe or, changing the order of data in series object., a.changeindex(), b.reindex(), c.rearrange(), d.reset_index(), , 18., , The digital data trail we leave online unintentionally is called _____, a. Active digital footprints, b. Passive digital footprints, c. Current digital footprints, d. None of the above, , 19., , The _______________ function iterates over a dataframe column wise and displaysthe dataframe, as vertical subsets., a.iterrows(), b.itercols(), c.itercolumns(), d.iteritems(), , 20., , E-waste stands for ______, a. Electrical waste, b. Electronic waste, c. Electricity waste, d. E-waste, , 21., , FOSS stands for __________, a. For open source software, b. Free and open set software
Page 83 :
22., , c. Free and open source software, d. None of the above, A ____________ is a type of contract between the creator of an original work permitting someone, to use their work, generally for some price., a. Agreement, b. License, c. Patent, d. Copyright, , 23., , Keys of the dictionary are used to construct the ___________ of the dataframe., a.columns, b.index, c.shape, d. values, , 24., , In order to work with CSV files from panda, we need to import, a. .csv, b.pandas.io, c. newcsv, d. No extra module required, , 25., , Which of the following command returns the total number of elements in a DataFrame?, a. shape, b. itemsize, c. size, d. nbytes, , Section – B, Section B consists of 24 Questions (26 to 49). Attempt any 20 questions., 26., , Which of the following is the correct Statement to save a plot/graph in the D: Drive of the system?, Assume matplotlib.pyplot is imported as plt, Statement-1: plt.savegraph(‘D:\\pic.png’), Statement-2: plt.savefig(‘D:\\pic.png’), Statement-3: plt.savefig(‘D:\pic.png’), Statement-1: plt.savegraph(‘D:\pic.png’), a.Both Statement-2 and Statement-3 are Correct., b.Only Statement-2 is Correct., c.Only Statemet-3 is Correct., d.Both Statement-1 and Statement-4 are Correct., , 27., , Following are some Statements about Data Handling in Python., Statement-1: The size of the Series data structure is immutable but the data values are mutable., Statement-2: Missing Data in a Python Series is represented by None., Statement-3: The function add() is used to add a new column in a Pandas DataFrame., Statement-4: By default, sorting of a DataFrame is done on row lables in ascending order., Which of the following is Correct?, a) Both Statement-1 and Statement-2 are Correct., b) Both Statement-1 and Statement-4 are Correct., c) Both Statement-2 and Statement-4 are Correct., d) Both Statement-3 and Statement-4 are Correct
Page 84 :
28., , Consider the Series in Python Pandas as given below:, , Rishav has written the following code to create the above Series with some gaps in the code:, import pandas as pd, year=_________________________________ # Statement-1, successrate=[64,76,91,94,89,92], c=pd.Series(successrate,__________), # Statement-2, printc., What should be written in, 1993,1994,1995,1995,1997,1998?, , 29., , 30., , Statement-1, , to, , create, , the, , List, , “year”, , storing, , a.year=(1993,1994,1995,1995,1997,1998), b.year={1993,1994,1995,1995,1997,1998}, c.year=[1993,1994,1995,1995,1997,1998], d.year=range(1993,1998), What should be written in Statement-2 to create the index of the Series as shown in the above, diagram?, a.index=successrate, b.index=[0,1,2,3,4,5,6,7], c.index=’year’, d.index=year, What should be the correct code for displaying the Series as:, , a.print(c[2:5]), b.print(c[3:6]), c.print(c[3:5]), d.print(c[2:6]), 31., , Choose the correct code for displaying the successrate above 90 along with the corresponding year, from the above Series., i) print(c>90), ii) print([c>90]), iii) print(c[c>90]), iv) print(c.loc[c>90]), a.Only (ii) is correct., b.Both (iii) and (iv) correct, c.Both (ii) and (iii) correct
Page 85 :
32., , d. Both (ii) and (iv) correct, ____________is a cybercrime in which a target or targets are contacted by email, telephone or text, message by someone posing as a legitimate institution to lure individuals into providing sensitive, data such as personally identifiable information, banking and credit card details, and passwords., a. Plagiarism, b. Phishing, c. Cyberstalking, d. Hacking, , 33., , 34., , 35., , Choose the correct Output of the following Python Code?, import pandas as pd, import numpy as np, A=np.arange(10,20,3), B=A+4, S=pd.Series(A,index=B., print(S), a., b., c., d. None of the above., 14 10, 10 14, 10 17, 17 13, 13 17, 14 13, 20 16, 20 16, 16 19, 23 19, 23 19, 23 20, Consider the following Series-S:, 0, North, 1, East, 2 West, 3 South, Which of the following Statements will recreate the Series as:, 1 East, 2 West, a.S=S.drop([1,4]), b.S=S.pop([0,3]), c.S=S.pop([1,4]), d. S=S.drop([0,3]), Which is the correct command to read 1st 10 records from a CSV File “Product.CSV” into a Pandas, Dataframe PR?, a.PR=pandas.DataFrame(‘Product.csv’,head=10), b.PR=pandas.read_csv(‘Product.csv’,rows=10), c.PR=pandas.DataFrame(‘Product.csv’,nrows=10), d. PR=pandas.read_csv(‘Product.csv’,nrows=10), , 36., , Which of the following is a characteristics of Data Visualisation?, a. Converts information., b. Involves visuals., c. Simplifies understanding., d. All of above, , 37., , Difference between loc() and iloc().:, a. Both are Label indexed based functions., b. Both are Integer position-based functions., c. loc() is label based function and iloc() integer position based function.
Page 86 :
d. loc() is integer position based function and iloc() index position based function., 38., , Electronic products that are unwanted, not working, and nearing or at the end of their “useful, life.”, known as, a. Computer Waste, b. E- Waste, c. Biological Waste, d. Chemical waste, , 39., , Which of the following is/are characteristics of DataFrame?, a. Columns are of different types, b. Can Perform Arithmetic operations, c. Axes are labeled (rows and columns), d. All of the above, , 40., , The following table shows the python code and its expected output., , Choose the correct word for blank space in line 3 for printing the column:, a. index, b. column, c. col, d. heads, , 41., , What are the etiquettes to create a safe pass word for Online sites, a. Choose password wisely it should be the combination of Capital, small letters , numbers and, special characters ., b. Keep the same password for all the Logins., c. Don’t change the password regularly., d. Share your password to your near ones., , 42., , What will be the output of following code:, dt=({'Name':['Akshit','Bharat','Chetan','Dhaval','Gaurang'], 'InternalMarks':[18,19,20,18,19],, 'AnnualExam':[76,78,80,76,73]}), df=pd.DataFrame(dt), Which of the following code will print names and Annual marks of students?, a. print(df.loc[:,’Name’:’AnnualExam’]), b. print(df.loc[‘Name’:’AnnualExam’]), c. print(df.loc[:,df.columns!=’InternalMarks’]), d. All of these, , 43., , What is the correct output for following Python code:, import pandas as pd, data = {"Marks1": 90, "Marks2": 95, "Marks3": 97}, ser = pd.Series(data., print(ser)
Page 87 :
a., Marks1 90, Marks2 95, Marks3 97, b., Marks1 Marks2 Marks3, 90, 95, 97, c., Marks1 Marks2 Marks3, 95, 90, 97, d.No output, 44., , Mr.Sharma is trying to write a code to plot line graph in green shown in fig-1. Help Mr. Sharma to, fill in the blanks of the code and get the desired output., , import matplotlib.pyplot as plt # statement 1, x = [1,2,3] # statement 2, y = [2,4,1] # statement 3, plt.plot(____________) #statement 4, plt.xlabel('x - axis'), plt.ylabel('y - axis'), plt.title ('My first graph!'), # function to show the plot, Plt.show(), Which of the following lines will be applicable for statement 4?, a.plt.plot(x, y, color=’g’), b.plt.plot(x, y, color= g), c.plt.plot( color=’g’,x,y), d.plt.plot(x, y, color=green), 45., , If Anu decides that her software should be available for free and the code to be open for all, it is, called as _________, a. Proprietary software, b. Free and open source software, c. Free software
Page 88 :
46., , 47., , 48., , d. None of the above, Assertion a. : pandas is an open source Python library which offers high performance, easy-to-use, data structures and data analysis tools., Reason (R) : Professionals and developers are using the pandas library in data science and machine, learning., 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, What is the correct syntax to return both the first row and the second row in a Pandas DataFrame, df?, a. df.loc[[0,1]], b. df.[[0,1]], c. df.loc[[0-1]], d. df.[[0-1]], Assertion a.:, Nidhi has create dataframe Df1, , She can expand or delete any row /column in this dataframe., Reason(R):, In python DataFrame objects can be concatenated or merged, 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., 49., , Statement a.: A bar chart represents categorical data with rectangular bars., Statement b.: It is an accurate graphical representation of the distribution of numerical data., 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, Section - C, Section C, consists of 6 Question (50 to 55). Attempt any 5 questions. Case Study, , Mr Rishi has created a dataframe Marks and wants to peform some operations on the dataframe.He is getting, confused with some functions.Help him find the correct options, , 50., , Choose the correct option to display the last 2 rows of the DataFrame., a.print(MARKS.tail(-2))
Page 89 :
b.print(MARKS.bottom(2)), c.print(MARKS.tail(2)), d. print(MARKS.loc[2]), 51., , Rishi wants to change the index of the above Dataframe to ‘A’,’B’,’C’,’D’. Help him to select the, correct command to do so., a.MARKS.index=[‘A’,’B’,’C’,’D’], b.MARKS=MARKS.index([‘A’,’B’,’C’,’D’]), c.MARKS=MARKS. (index={1:’A’,2:’B’,3:’C’,4:’D’}), d. index=[‘A’,’B’,’C’,’D’], , 52., , What will the following Python Code produce Output?, print(MARKS[MARKS[‘SEM-2’]>80].Name), a., 2 Anand Sharma, 3 Deeksha Sen, b., 2 Anand Sharma, 1, Mohan Sharma, c., 3, 4, , Deeksha Sen, Pramod Nair, , d. None of the above., 53., , What is the size of the above dataframe?, a. 4, b.16, c.12, d.8, , 54., , Which command in Python Pandas will display the above dataframe in the transpose form i.e., interchanging rows and columns?, a.>>>MARKS.T, b.>>>MARKS.t, c.>>>T(MARKS), d.>>>t(MARKS), , 55., , He 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[:]=0, d. DF[:]==0
Page 90 :
KENDRIYA VIDYALAYA SANGATHAN, KOLKATA REGION, FIRST PRE-BOARD EXAMINATION (2021-2022), CLASS-XII, SUBJECT-INFORMATICS PRACTICES (065), MARKING SCHEME, , 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., THE CORRECT ANSWER HAS BEEN HIGHLIGHTED IN BOLD, Section – A, Section A consists of 25 questions, attempt any 20 questions., 1., , Which of the following are modules/libraries in Python?, a., b., c., d., , 2., , __________ is an important library used for analyzing data., a., b., c., d., , 3., , NumPy, Pandas, Matplotlib, All of the above, , Math, Random, Pandas, None of the above, , The command to install the matplotlib is:, a. install pip matplotlib, b. install matplotlib, c. pip matplotlib, d. pip install matplotlib, , 4., , The ndim for a Series will give:, a., b., c., d., , 5., , 0, 1, 3, 2, , Python was developed by:, a. Guido van Rossum, b. Travis Oliphant
Page 91 :
6., , c. Wes McKinney, d. Brendan Eich, The command used to give a title along X-Axis to a graph is _________., a., b, c., d., , LabelX(), xtitle(), xlabel(), label(), , 7., , What is the minimum number of arguments required for DataFrame() function in Pandas?, , 8., , a. 1, b. 0, c. 2, d. 3, Method or function to display the first five rows in a data frame is:, a., b., c., d., , 9., , heads(), head(), xlabel(), label(), , Write the correct option for the method used in Pandas to delete columns in dataframe, a)delete(), b)drop(), c)remove(), d)pop(), , 10., , ____________ is a graphical representation of the distribution ofnumerical data by showing the, number of data points that fall within a specifiedrange of values., (a) Histogram, (b) Frequency Polygon, (c) Bar Graph, (d) None of these, , 11., , Which of the following is not an intellectual property?, (a) A poem written by a poet, (b) An original painting made by a painter, (c) Trademark of a Company, (d) A remixed song, , 12., , In this era of digital society, we can do _____________, a)Online Shopping, b) Online Banking, c) Online Education, d)All of the above, , 13., , Proprietary software is a software which is available _________, a. free of charge
Page 92 :
b. on paying license fee, c. free for first year only, d. none of the above, 14., , NumPy stands for ____, a.Number Python, b. Numerical Python, c. Numbers in Python, d. None of the aboveS., , 15., , Ravi copies some contents from Internet, but do not mention the source or the original creator., This is an act of ______, a. Plagiarism, b. Copyright Infringement, c. Trademark Infringement, d. Licence Infringement, , 16., , Bad posture of using computer may cause _____, a.Backache, b. Neck Pain, c. Shoulder pain, d. All of the above, , 17., , 18., , _____________ function is used for changing the order of rows and columns in a dataframe or, changing the order of data in series object., (a) changeindex(), (b) reindex(), (c) rearrange(), (d) reset_index(), The digital data trail we leave online unintentionally is called _____, a. Active digital footprints, b. Passive digital footprints, c. Current digital footprints, d. None of the above, , 19., , The _______________ function iterates over a dataframe column wise and displaysthe dataframe, as vertical subsets., (a), (b), (c), (d), , 20., , iterrows(), itercols(), itercolumns(), iteritems(), , E-waste stands for ______
Page 93 :
a. Electrical waste, b. Electronic waste, c. Electricity waste, d. E-waste, 21., , FOSS stands for __________, a. For open source software, b. Free and open set software, c. Free and open source software, d. None of the above, , 22., , A ____________ is a type of contract between the creator of an original work permitting, someone to use their work, generally for some price., a. Agreement, b. License, c. Patent, d. Copyright, , 23., , Keys of the dictionary are used to construct the ___________ of the dataframe., (a), columns, (b), index, (c), shape, (d), values, , 24., , In order to work with CSV files from panda, we need to import, i. .csv, ii.pandas.io, iii. newcsv, iv. No extra module required, , 25., , Which of the following command returns the total number of elements in a DataFrame?, a) shape, (b) itemsize, (c) size, (d) nbytes, , Section – B Section B consists of 24 Questions (26 to 49). Attempt any 20 questions., 26., , Which of the following is the correct Statement to save a plot/graph in the D: Drive of the system?, Assume matplotlib.pyplot is imported as plt, Statement-1: plt.savegraph(‘D:\\pic.png’), Statement-2: plt.savefig(‘D:\\pic.png’), Statement-3: plt.savefig(‘D:\pic.png’), Statement-1: plt.savegraph(‘D:\pic.png’), (a) Both Statement-2 and Statement-3 are Correct.
Page 94 :
(b) Only Statement-2 is Correct., (c) Only Statemet-3 is Correct., (d) Both Statement-1 and Statement-4 are Correct., , 27., , Following are some Statements about Data Handling in Python., Statement-1: The size of the Series data structure is immutable but the data values are mutable., Statement-2: Missing Data in a Python Series is represented by None., Statement-3: The function add() is used to add a new column in a Pandas DataFrame., Statement-4: By default, sorting of a DataFrame is done on row lables in ascending order., Which of the following is Correct?, a) Both Statement-1 and Statement-2 are Correct., b) Both Statement-1 and Statement-4 are Correct., c) Both Statement-2 and Statement-4 are Correct., d) Both Statement-3 and Statement-4 are Correct, , 28., , Consider the Series in Python Pandas as given below:, , Rishav has written the following code to create the above Series with some gaps in the code:, import pandas as pd, year=_________________________________ # Statement-1, successrate=[64,76,91,94,89,92], c=pd.Series(successrate,__________), # Statement-2, print(c), What should be written in, 1993,1994,1995,1995,1997,1998?, , 29., , 30., , Statement-1, , to, , create, , the, , List, , “year”, , storing, , (a) year=(1993,1994,1995,1995,1997,1998), (b) year={1993,1994,1995,1995,1997,1998}, (c) year=[1993,1994,1995,1995,1997,1998], (d)year=range(1993,1998), What should be written in Statement-2 to create the index of the Series as shown in the above, diagram?, (a) index=successrate, (b) index=[0,1,2,3,4,5,6,7], (c) index=’year’, (d) index=year, What should be the correct code for displaying the Series as:
Page 95 :
31., , 32., , 33., , 34., , 35., , (a) print(c[2:5]), (b) print(c[3:6]), (c) print(c[3:5]), (d)print(c[2:6]), Choose the correct code for displaying the successrate above 90 along with the corresponding year, from the above Series., i) print(c>90), ii) print([c>90]), iii) print(c[c>90]), iv) print(c.loc[c>90]), (a) Only (ii) is correct., (b) Both (iii) and (iv) correct, (c) Both (ii) and (iii) correct, (d) Both (ii) and (iv) correct, ____________is a cybercrime in which a target or targets are contacted by email, telephone or text, message by someone posing as a legitimate institution to lure individuals into providing sensitive, data such as personally identifiable information, banking and credit card details, and passwords., a. Plagiarism, b. Phishing, c. Cyberstalking, d. Hacking, Choose the correct Output of the following Python Code?, import pandas as pd, import numpy as np, A=np.arange(10,20,3), B=A+4, S=pd.Series(A,index=B), print(S), (a), (b), (c), (d) None of the above., 14 10, 10 14, 10 17, 17 13, 13 17, 14 13, 20 16, 20 16, 16 19, 23 19, 23 19, 23 20, Consider the following Series-S:, 0, North, 1, East, 2 West, 3 South, Which of the following Statements will recreate the Series as:, 1 East, 2 West, (a) S=S.drop([1,4]), (b) S=S.pop([0,3]), (c) S=S.pop([1,4]), (d) S=S.drop([0,3]), Which is the correct command to read 1st 10 records from a CSV File “Product.CSV” into a Pandas, Dataframe PR?, (a) PR=pandas.DataFrame(‘Product.csv’,head=10)
Page 96 :
(b) PR=pandas.read_csv(‘Product.csv’,rows=10), (c) PR=pandas.DataFrame(‘Product.csv’,nrows=10), (d) PR=pandas.read_csv(‘Product.csv’,nrows=10), 36., , Which of the following is a characteristics of Data Visualisation?, (a) Converts information., (b) Involves visuals., (c) Simplifies understanding., (d) All of above, , 37., , Difference between loc() and iloc().:, a. Both are Label indexed based functions., b. Both are Integer position-based functions., c. loc() is label based function and iloc() integer position based function., d. loc() is integer position based function and iloc() index position based function., , 38., , Electronic products that are unwanted, not working, and nearing or at the end of their “useful, life.”, known as, a. Computer Waste, b. E- Waste, c. Biological Waste, d. Chemical waste, , 39., , Which of the following is/are characteristics of DataFrame?, a) Columns are of different types, b) Can Perform Arithmetic operations, c) Axes are labeled (rows and columns), d) All of the above, , 40., , The following table shows the python code and its expected output., , Choose the correct word for blank space in line 3 for printing the column:, a. index, b. column, c. col, d. heads, , 41., , 42., , What are the etiquettes to create a safe pass word for Online sites, a. Choose password wisely it should be the combination of Capital, small letters , numbers and, special characters ., b. Keep the same password for all the Logins., c. Don’t change the password regularly., d. Share your password to your near ones.
Page 98 :
import matplotlib.pyplot as plt # statement 1, x = [1,2,3] # statement 2, y = [2,4,1] # statement 3, plt.plot(____________) #statement 4, plt.xlabel('x - axis'), plt.ylabel('y - axis'), plt.title ('My first graph!'), # function to show the plot, Plt.show(), Which of the following lines will be applicable for statement 4?, a)plt.plot(x, y, color=’g’), b)plt.plot(x, y, color= g), c)plt.plot( color=’g’,x,y), d)plt.plot(x, y, color=green), 45., , If Anu decides that her software should be available for free and the code to be open for all, it is, called as _________, a) Proprietary software, b) Free and open source software, c) Free software, d) None of the above, , 46., , Assertion (A) : pandas is an open source Python library which offers high performance, easyto-use data structures and data analysis tools., Reason (R) : Professionals and developers are using the pandas library in data science and, machine learning., 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, , 47., , What is the correct syntax to return both the first row and the second row in a Pandas, DataFrame df?, a. df.loc[[0,1]], b. df.[[0,1]], c. df.loc[[0-1]], d. df.[[0-1]], Assertion (A):, Nidhi has create dataframe Df1, , 48., , She can expand or delete any row /column in this dataframe., Reason(R):, In python DataFrame objects can be concatenated or merged, 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.
Page 99 :
49., , Statement (A): A bar chart represents categorical data with rectangular bars., Statement (B): It is an accurate graphical representation of the distribution of numerical data., 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, , Section - C Section C, consists of 6 Question (50 to 55). Attempt any 5 questions. Case Study, Mr Rishi has created a dataframe MARKS and wants to peform some operations on the dataframe.He is getting, confused with some functions.Help him find the correct options, , 50., , Choose the correct option to display the last 2 rows of the DataFrame., (a) print(MARKS.tail(-2)), (b) print(MARKS.bottom(2)), (c) print(MARKS.tail(2)), (d) print(MARKS.loc[2]), , 51., , 52., , Rishi wants to change the index of the above Dataframe to ‘A’,’B’,’C’,’D’. Help him to select the, correct command to do so., (a) MARKS.index=[‘A’,’B’,’C’,’D’], (b) MARKS=MARKS.index([‘A’,’B’,’C’,’D’]), (c) MARKS=MARKS. (index={1:’A’,2:’B’,3:’C’,4:’D’}), (d) index=[‘A’,’B’,’C’,’D’], What will the following Python Code produce Output?, print(MARKS[MARKS[‘SEM-2’]>80].Name), (a), 2 Anand Sharma, 3 Deeksha Sen, (b), 2 Anand Sharma, Mohan Sharma, (c), 3, 4, , Deeksha Sen, Pramod Nair, , (d) None of the above., 53., , What is the size of the above dataframe?, a) 4, b)16
Page 100 :
c)12, d)8, 54., , Which command in Python Pandas will display the above dataframe in the transpose form i.e., interchanging rows and columns?, (a) >>>MARKS.T, (b) >>>MARKS.t, (c) >>>T(MARKS), (d) >>>t(MARKS), , 55., , He wants to set all the values to zero in data frame, choose the right command to do so:, a. MARKS=0, b. MARKS[]=0, c. MARKS[:]=0, d. MARKS[:]==0
Page 113 :
Kendriya Vidyalaya No.2 Tambaram, Chennai, Question Paper, , Term-I, , Subject: Informatics Practices (Code-065), Allowed: 90 minutes, Class – XII, , Time, Maximum Marks: 35, , General Instructions:, 1. The paper is divided into 3 Sections- A, B and C., 2. Section A, consists of Question 1 to 25 and student need to attempt 20, questions., 3. Section B, consists of Question number 26 to 49 and student need to, attempt 20 questions., 4. Section C, consists of Question number 50 to 55 and student need to, attempt 5 questions., 5. All questions carry equal marks., , 1, 2, 3, 4, , 5, , Section – A, Section A consists of 25 questions, attempt any 20 questions, To get the number of dimensions of a Series object which of the following, attribute can be used?, a. Shape, b. Ndim, c. Size, d. None of the above, To display first three elements of a Series object S, you may write, a. S.tail(), b. S.tail(3), c. S.head(3), d. S.head(), The rows of a DataFrame are identified with axis _____ ., a. 3, b. 2, c. 1, d. 0, Which of the following function is used to extract data from a Series based, on numeric index?, a. loc ( ), b. iloc( ), c. tail( ), d. head( ), In Pandas the function used to delete a column or a row in a DataFrame is, ________., a. delete, b. del, c. drop, d. pop, Which of the following is not Pandas data structure?, , 6, 7, , 8, , 9, 10, , a. Series, b. Data Frame, c. Queue, d. Panel, The function used to display graph is ______________, a. display( ), b. Print( ), c. savefig ( ), d. show ( ), 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. iii, To plot x versus y, we can write ________________ #plt is an alias for, matplotlib.pyplot, a. plt.plot(y, x), b. plt.plot(x), c. plt.plot(x,y), d. plt.plot(y), To check if the Series object contains NaN values, ----------------- attribute is, , Page 1| 8
Page 114 :
displayed., , 11, , 12, , a. isna, b. hasna, c. nan, d. hasnans, In given code dataframe ‘D1’ has ________ rows and _______ columns., import pandas as pd, LoD = [{‘a’:10, ‘b’:20}, {‘a’:5, ‘b’:10, ‘c’:20},{‘a’:7, ‘d’:10, ‘e’:20}], D1 = pd.DataFrame(LoD), a. 3, 3, b. 3, 4, c. 3, 5, d. 5,3, _Digital ___________ is a way of authenticating the identity of the creator or, producer of digital information., a. Signature, b. Footprint, c. Security, d. Safety, 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 ., , 13, , 14, 15, , 16, , 17, , 18, , 19, , 20, 21, , a. Increase the life span of a product by repairing, b. Use refabricated productes, c. Burry the products in landfill, d. Company gives the buy back option, By encryption of a text we mean, a. Compressing it, b. Expanding it, c. Scrambling it to preserve its security, d. Hashing it, Which of the following is not a type of cyber crime?, a. Data theft, b. Forgery, c. Damage to data and systems, d. Plagiarise the content, Which of the following is an disadvantage of open source software?, a. High quality software with lots of features, b. Not as customizable, c. May not have been tested as much as proprietary software, thus might, have bugs, d. You can edit the source code to customize it, _____________refers to a type of malware that displays unwanted, advertisement on your computer or device., a. Pharming, b. Spyware, c. Addware, d. Malware, Ramya has written a poem. Under which of the following will it be, protected?, a. Patent, b. Trademark, c. Copyright, d. Designs, GPL licence is given for, a. Open Source Software, b. Propriatary Software, c. Inventions, d. None of the above, ________ are websites or applications that enable users to participate by, creating and sharing content with others in the community., a. Social media, b. Social channel, c. Social networking, d. None of the above, A Series is created with 10 element including one missing value. How many, elements would be displayed by the following command?, print(s.count), a. 10, , b. 9, , Page 2| 8
Page 115 :
22, 23, , 24, , c. Error, d. Can not predict as data type is not known, The axis 1 identifies a dataframe's, a. rows, b. columns, c. values, d. datatype, Which of the following parameters of the read_csv function is used to make, one of the columns of the data in the csv file as index of the data frame., a. skiprows, b. index_row, c. nrows, d. index_col, Code to create the dataframe:, import pandas as pd, df=pd.DataFrame([[21,22,19,22],[23,22,16,17],[30,25,26,21]],\, ______ =['S1','S2','S3'])#statement 1, Which of the following would correctly complete the statement 1?, , 25, , a. row, b. column, c. columns, d. index, All Pandas' data structures are ……… mutable but not always ………………, mutable., (a) size, value, (b) semantic, size, (c) value, size, (d) none of these, Section – B Section B consists of 24 Questions (26 to 49)., Attempt any 20 questions., Consider the following graph. Which of the following function is used to, display the circled part of graph?, a., , 26, , plt.xlabel( ), , b. plt.ylabel, , c. plt.show, , d. plt.title, , Page 3| 8
Page 116 :
27, , 28, , 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, Read the statements given below and identify the right option, Statement A: A Line plot is a graph that shows the frequency of a data, along a number line., Statement B: The legend is displayed by default associating the colours, with the plotted data., a. Statement A and B are correct and Statement B is correct Explanation of, statement A., b. Statement A and B are correct and Statement B is not correct, Explanation of statement A., c. Statement A is correct, but Statement B is incorrect, d. Statement A is incorrect, but Statement B is correct, What will be the output of the following code?, , import pandas as pd, series1 = pd.Series([10,20,30]), print(series1), 29, , a. 0 10, b. 10 10, c. 1 10, 1 20, 20 20, 2 20, 2 30, 30 30, 3 30, dtype: int64, dtype: int64, dtype: int64, import pandas as pd, Capital=['Delhi',’Beijing’,’Tokyo’,’Berlin”], Country=['India','China','Japan','Germany'], 30, , d. -1 10, -2 20, -3 30, dtype: int64, , Which of the following will create a Series?, a. S=df.Series(Capital,index=Country), b. S=df.series(capital,index=country), c. S=df.Series(capital,country), d. S=pd.Series(capital,index=country), , 31, , 32, 33, , Read the statements given below and identify the right option, Statement A: fill_value parameter in the add( ) function can be used to, replace the NaN value during addition operation., Statement B: NaN in a Series represent missing data., a. Statement A and B are correct and Statement B is correct Explanation of, statement A., b. Statement A and B are correct and Statement B is not correct, Explanation of statement A., c. Statement A is correct, but Statement B is incorrect, d. Statement A is incorrect, but Statement B is correct, , 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, Which of the following will NOT become a part of digital footprint ?, a. Website visited by you, b. Facebook comment, Page 4| 8
Page 117 :
c. Using google map for a destination, , d. Taking selfie, , Read the statements given below and identify the right option, Statement A: A phone call from someone purporting to represent a, financial institution you do business with and are asked to provide or, update personal or account information., Statement B: Identity theft is a serious cyber crime involving the using, personal information to commit fraud., 34, , 35, , a. Statement A and B are correct and Statement B is correct Explanation of, statement A., b. Statement A and B are correct and Statement B is not correct, Explanation of statement A., c. Statement A is correct, but Statement B is incorrect, d. Statement A is incorrect, but Statement B is correct, GPL stands for ___________, a. General Public License, b. GNU General Private License, c. GNU General Public License, d. GNU Public License, 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., , 36, The incidence given above is an example of...., , 37, 38, , 39, , 40, , a. Identity Theft, b. Cyber Trolling, c. Financial Fraud, d. Phishing, ____________ operating system come under FOSS., a. Ubuntu, b. Unix, c. Mac, d. Windows, Which hazardous chemical is common in the discarded batteries?, a. Lead, b. Iron, c. Arsenic, d. Lithium, What will be the output for the following code ?, import pandas as pd, import numpy as np, S = pd.Series (np.random.randint(2,size=(10,)), print (S.size), a. 0, b. 1, c. 10, d. None of the above, , Consider the dataframe below as (df1), , What will be the output produced by print df.Marks/2?, a. 0 45.0, 1 NaN, 2 43.5, Name: Marks, dtype: float64, , b. 0 45, 1 NaN, 2 43.5, Name: Marks, dtype: float64, , c. 0 45.0, 1 NaN, , d. 0 45.0, 10, Page 5| 8
Page 118 :
2 43, Name: Marks, dtype: float64, , 2 43.5, Name: Marks, dtype: float64, , Following code has syntax error., , 41, , import pandas as pd, # Line 1, s = pd.series([1,2,3,4,5],index = ['a','b','c','d','e']) # Line 2, print (s[[‘a’,'c','d']]), # Line 3, Identify the line having the error., a. Line 1, b. Line 2, c. Line 3, Consider the following DataFrame ‘df’., , d. Line 2 and Line 3, , 42, Which of the following command will add a column named ‘Marks’ with, value 10., , 43, , 44, , a. df.Marks = 10, b. df[Marks]=10, c. df[‘Marks’]=10, d. df.loc['Marks']=10, Which command will be used to delete 3 and 5 rows of the data frame?, Assuming the data frame name as DF., a. DF.drop([2,4],axis=0), b. DF.drop([2,4],axis=1), c. DF.drop([3,5],axis=1), d. DF.drop([3,5]), Ritika 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"]), d. df=pd.DataFrame({Name:"Name", Phy :"Phy",Chem: "Chem"}), Consider the following DataFrame ‘df’ with ‘ID’ as index., , 45, Which of the following command will extract the complete row ‘T03’., , 46, , a. df.loc[ : , ‘ID’], b. df.loc[‘T03’ , ‘Name’], c. df.loc[‘T02’,’T03’], d. df.loc[‘T03’, : ], Write a command to display the rows of the DataFrame ‘df’., , Page 6| 8
Page 119 :
a. df.values(), b. df.rows, c. df.columns(), Consider the DataFrame ‘df’ with following data., , 47, , Name, , Weight, , Height, , S1, , Pawan, , 50, , 153, , S2, , Jeewan, , 56, , 161, , S3, , Dhawan 59, , 149, , d. df.values, , What will be the output of the following statement?, df[‘Name’].max(), a. Pawan, b. Jeewan, c. Dhawan, Consider the followng DataFrame ‘contact’., , d. Error, , 48, Choose the correct function to rename city columns to location., a. df.rename(columns={‘City’:’Location’}), b. df.rename(columns={‘City’=’Location’}), c. df.rename(‘City’=’Location’), d. df.rename(df.columns(‘City’,’Location’)), Consider the following Series object ‘fur’,, , 49, , What will be the output of the following command?, print(fur>300), a. True, b. Table, 350, c. 350, d. Table, True, False, Chair, False, False, Sofa, False, False, Stool, False, Section C, consists of 6 Question (50 to 55). Attempt any 5, questions., Case Study, , Consider the following Data Frame df., Name Rollno English Hindi Maths Ssc Science, 0 Anita, 1, 55, 45 87, 67, 70, Page 7| 8
Page 121 :
Kendriya Vidyalaya No.2 Tambaram, Chennai, Question Paper, Term-I, Subject: Informatics Practices (Code-065), Time Allowed: 90, minutes, Class – XII, Maximum Marks: 35, ANSWER KEY, Q.No, , Ans, , Q.No., , Ans, , Q.No., , Ans, , Q.No., , Ans, , Q.No., , Ans, , 1, , B, , 12, , A, , 23, , D, , 34, , B, , 45, , D, , 2, , C, , 13, , C, , 24, , C, , 35, , A, , 46, , D, , 3, , D, , 14, , C, , 25, , C, , 36, , C, , 47, , A, , 4, , B, , 15, , D, , 26, , D, , 37, , A, , 48, , A, , 5, , C, , 16, , C, , 27, , D, , 38, , D, , 49, , D, , 6, , C, , 17, , C, , 28, , D, , 39, , C, , 50, , B, , 7, , D, , 18, , C, , 29, , A, , 40, , A, , 51, , B, , 8, , C, , 19, , A, , 30, , A, , 41, , B, , 52, , A, , 9, , C, , 20, , A, , 31, , A, , 42, , C, , 53, , A, , 10, , D, , 21, , A, , 32, , B, , 43, , D, , 54, , C, , 11, , C, , 22, , B, , 33, , D, , 44, , A, , 55, , A
Page 122 :
KENDRIYA VIDYALAYA SANGATHAN, TINSUKIA REGION, Informatics Practices (065) (Theory), Term 1 (Practice Test) Examination 2021 -2022, Class – XII, MARKING SCHEME, Max Marks: 35, , •, •, •, •, •, Q.No, 1, , 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., What is the main purpose of using pandas library in Python?, a), b), c), d), , 2, , Max Time: 90 mins., , to create a GUI programming, to create a Database, for data analysis, for numerical calculations, , Which of the following is not Pandas data structure?, a), b), c), d), , Series, Data Frame, Queue, Panel, , 3, , In a Series, to know about the dimensions(number of axis), we use, , 4, , a) <objectname>.ndim, b) <objectname>.dim, c) <objectname>.nsize, d) <objectname>.nbytes, Pandas series is a combination of, a), b), c), d), , 5, , 6, , Records arranged in row and column, Collection of 1 dimensional data and associated index, Collection of 2 dimensional data, Collection of 3 dimensional data, , Which of the following pandas attributes gives output in the form of tuple?, (a) nbytes, (b) ndim, (c) shape, (d) size, Ms Shaila want to display the monthly expenditure of a School using a bar graph. Which library she, must import so that she can display the expenditure data using a bar graph., IP/065/XII/2021-22, , Page |1
Page 123 :
a), b), c), d), 7, , 8, , pandas, plot.pyplot, matplotlib.pyplot, numpy.pyplot, , Which of the following is not a valid line style in matplotlib?, (a) ‘-’, (b) ‘--’, (c) ‘-.’, (d) ‘<’, Using Python Matplotlib, out of the following which can be used to count how many values fall into, each interval ?, , 9, , a) Line plot, b) Bar graph, c) Histogram, d) Charts, Which of the following is not an attribute of a data frame?, , 10, , a) value, b) size, c) shape, d) dtypes, Which of the following correct statement to import pyplot module?, , 11, , a) import matplotlib.pyplot, b) import MatPlotLib.PyPlot, c) import PyPlot as pl, d) import pyplot.plot, Which of the following activity is an example of leaving Active digital footprints?, , 12, , a. Surfing internet, b. Visiting a website, c. Sending an email to friend, d. None of the above, Rahul, owner of a movie parlour, produces and sells pirated CDs and DVDs to his customers. Identify, the type of activity he is engaged in., , 13, , a) Ethical hacking, b) Helping people showing new movies, c) Identity theft, d) Cybercrime, Proprietary software is a software which is available _________, , 14, , a) free of charge, b) on paying license fee, c) free for first year only, d) d. none of the above, Consider a code, df=pd.DataFrame([2,4,5,9],index=[True,False,False,True]), Which of the following is used to create the above dataframe?, a) Created using Series, b) Created using List of Dictionary, c) Created using Boolean indexing, IP/065/XII/2021-22, , Page |2
Page 124 :
15, , d) Created using Strings, The name and logo of the software will be protected by ___________, a), b), c), d), , 16, , ________ are websites or applications that enable users to participate by creating, and sharing content with others in the community., a), b), c), d), , 17, , copyright, patent, registered trademark, d. None of the above, , Social media, Social channel, Social networking, d. None of the above, , Data Frame is having True and False as its boolean indexes. The command that can be used to access, all the rows corresponding to True boolean index is, , 18, , (a) print(df.loc(True), (b) print(df.loc[:,True]), (c) print(df.loc[True]), (d) print(df.loc(True,:), ___________ means using other’s work and not giving adequate citation for use., , 19, , a. Plagiarism, b. Licensing, c. Copyright, d. None of the above, Function to display the last n rows in the DataFrame:, , 20, , a., tail (n), b., head (n), c., top (n), d., first (n), The process of re-selling old electronic goods at lower prices is called ____, , 21, , a. refurbishing, b. recycle, c. reuse, d. reduce, Which of the following is not correct in respect of digital communication?, , 22, , a) Digital communication includes email., b) Digital communication includes instant messaging., c) Digital communication includes face to face talking., d) Digital communication includes talking over the cell phone., What is the name of the IT law that India is having in the Indian legislature?, a), b), c), d), , India's Technology IT Act 2000, India's Digital information technology DIT Act, 2000, India's Information Technology IT Act, 2000, d. The technology act, 2008., , IP/065/XII/2021-22, , Page |3
Page 125 :
23, , Assume an empty DataFrame df. The command, df.loc[‘a’] = [‘A’, ’B’, ’C’] will add a new, , 24, , a) Row to the DataFarme, b) A new column to the DataFrame, c) Will generate an error, d) None, Which of the following object you get after reading CSV file by using pandas?, , 25, , a) DataFrame, b) Character Vector, c) Panel, d) All of the mentioned, In given code dataframe ‘D1’ has ________ rows and _______ columns., import pandas as pd, LoD = [{‘a’:10, ‘b’:20}, {‘a’:5, ‘b’:10, ‘c’:20},{‘a’:7, ‘d’:10, ‘e’:20}], D1 = pd.DataFrame(LoD), a) 3, 3, b) 3, 4, c) 3, 5, d ) None of the above, , 26, , Section B consists of 24 Questions (26 to 49). Attempt any 20 questions, Select the correct statement to assign a new name MySeries to a series object named s ?, a), b), c), d), , 27, , Section – B, , s.Name(‘MySeries’), s.name=’MySeries’, s(‘MySeries’), s.Name=’MySeries’, , How many elements will be there in the series named “S1”?, S1 = pd.Series(range(5)), print(S1), , 28, , a) 5, b) 4, c) 6, d) d. None of the mentioned, What will be the output of following code:, import pandas as pd, s=pd.Series([11,12,13,14,15,16]), s[1:4] = 20, s=list(s), print(l), Select the correct output:, a), b), c), d), , [11, 20, 20, 20, 15, 16], [20, 20, 20, 20, 15, 16], [20, 12, 13, 20, 15, 16], [11, 20, 13, 20, 15, 16], , IP/065/XII/2021-22, , Page |4
Page 126 :
29, , 30, , _______ is a person who deliberately sows discord on the Internet by starting quarrels or upsetting, people, by posting inflammatory or off topic messages in an online community., a) Netizen, b) Digital Citizen, c) Internet troll, d) d. None of the above, Consider the following graph ., , Identify the code to plot it., a. import matplotlib.pyplot as plt, plt.plot ([2,7],[1,6]), plt.show( ), b. import matplotlib.pyplot as plt, plt.plot([1,6],[2,7]), plt.show( ), c. import matplotlib.pyplot as plt, plt.plot([2,3],[5,1]), plt.show( ), , 31, , d. import matplotlib.pyplot as plt, plt.plot([1,3],[4,1]), plt.show( ), In the questions given below there are two statements marked as Assertion (A) and Reason (R) . Read, the statements and choose the correct option., 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., Assertion (A): Pandas offer a single and convenient place to plot graphs i.e. matplotlib for, visualization and data analysis through graphs., Reason (R): Matplot is a 2-D plotting library that helps in visualizing figures., , IP/065/XII/2021-22, , Page |5
Page 127 :
32, , Which function can be used to export generated graph in matplotlib to png ?, a) savefigure, c) save, , 33, , 34, , b) savefig, d) export, , Mala is confused about the free operating system available in the market. Few of her friends, suggested a few operating systems. Help her in choosing free operating system for her device:, a. Ubuntu, b. Windows, c. Mozilla Firefox, d. Blender, Choose the correct code for the following statements being correct or incorrect., Statement I: Intellectual Property is a category of property that includes intangible creations of the, human intellect., Statement II: IPR does not include trade secrets and moral rights., , 35, , 36, , a) Both the Statements I and II are correct., b) Both the Statements I and II are incorrect., c) Statement I is correct ,but II is incorrect., d) Statement II is correct ,but I is correct., Which of the following code will generate the following output?, Jan 31, Feb 28, Mar 31, dtype: int64, a. import pandas, S1 = pd.Series(data = [31,28,31], index=["Jan","Feb","Mar"]), print(S1), b. import pandas as pd, S1 = p1.series([31,28,31], index=["Jan","Feb","Mar"]), print(S1), c. import pandas as pd, S1 = pd.Series([31,28,31], columns=["Jan","Feb","Mar"]), print(S1), d. import pandas as pd, S1 = pd.Series([31,28,31], index=["Jan","Feb","Mar"]), print(S1), After using his email id, Anubhav forgot to sign off from his email account. Later, his servant saw his, computer open and started using it. His servant’s activity is an example of which of the following, cybercrime?, a), b), c), d), , 37, , Hacking, Identity theft, Cyber bullying, Plagiarism, , We can add a new row to a DataFrame using the _____________ method ?, a), b), c), d), , rloc[ ], loc[ ], iloc[ ], None of the above, , IP/065/XII/2021-22, , Page |6
Page 128 :
38, , Which of the following is the correct related to E-waste?, a) E-waste is a popular, informal name for electronic products nearing the end of their "useful, life., b) Computers, televisions, VCRs, stereos, copiers, and fax machines are common electronic, products., c) Both A and B, d) (iv) None of the above, , 39, , Which of the following are ways of indexing to access Data elements in a DataFrame?, , 40, , a. Label based indexing, b. Boolean Indexing, c. Both (a) & (b), d. None of the above, What will be the output of the following code:, import pandas as pd, s1=pd.Series([4,5,7,8,9],index=['a','b','c','d','e']), s2=pd.Series([1,3,6,4,2],index=['a','p','c','d','e']), print(s1-s2), a), a 3.0, b0, c 1.0, d 4.0, e 7.0, p0, dtype: float64, b), a 3.0, b NaN, c 1.0, d 4.0, e 7.0, p NaN, dtype: float64, c), a 3.0, c 1.0, d 4.0, e 7.0, dtype: float64, d), , 41, , a 3.0, b–, c 1.0, d 4.0, e 7.0, p–, dtype: float64, The fraudulent practice of directing internet users to a bogus website that mimics, IP/065/XII/2021-22, , Page |7
Page 129 :
the appearance of legitimate one in order to obtain personal information such as, passwords, accounts numbers etc. This is known as ____________________, , 42, , 43, , a) Eavesdropping, b) Pharming, c) Bullying, d) Trolling, Difference between loc() and iloc():, a. Both are Label indexed based functions., b. Both are Integer position-based functions., c. loc() is label based function and iloc( ) integer position based function., d. loc() is integer position based function and iloc( ) index position based, function., What will the output of the following code:, import pandas as pd, s1=pd.Series([4,5,7,8,9],index=['a','b','c','d','e']), s2=pd.Series([1,3,6,4,2],index=['a','p','c','d','e']), print(s1==s2), a), a True, b False, c True, d False, e True, dtype: bool, b), a False, b False, c False, d False, e False, dtype: bool, c), , d), , 44, , a True, b True, c True, d True, e True, dtype: bool, , Error, Sheena is a new learner for the python pandas, and she is aware of some concepts of python. She has, created a dataframe , Help her by identifying the correct output :, import pandas as pd, d = {'one' : pd.series([1., 2., 3.], index = ['a', 'b', 'c']), 'two' : pd.series([1., 2., 3., 4.], index = ['a', 'b', 'c',, 'd'])}, df = pd.Dataframe(d), print(df), (a), one two, a 1.0 1.0, b 2.0 2.0, c 3.0 3.0, d NaN 4.0, IP/065/XII/2021-22, , Page |8
Page 130 :
45, , (b), one two, d NaN 4.0, b 2.0 2.0, a 1.0 1.0, (c), two three, d 4.0 NaN, a 1.0 NaN, (d), Error, Protecting computers and the information it contain against unwanted access, malicious code,, destruction is called, , 46, , a) computer monitoring, b) electric policy, c)audit control, d)computer security, Assuming the given structure, which command will give us the given output:, , 47, , Which command will give the output 24:, a) print(df.size), b) print(df.shape), c) print(df.index), d) d. print(df.axes), Consider the following DataFrame df and answer the question ?, , The output:, , will be produced by:, a) a.df.show[1:3,0:2], b) b.df.at[1:3,0:2], IP/065/XII/2021-22, , Page |9
Page 131 :
c) c.df.loc[1:3,0:2], d) df.iloc[1:3,0:2], 48, , Consider the following data frame – DF:, , 0, 1, 2, 3, , SUBCODE, 48, 83, 65, 29, , Name, PHYSICAL EDUCATION, COMPUTER SCIENCE, INFORMATICS PRACTICES, GEOGRAPHY, , Which of the following Python statement can be used to rename the column Name as SubjectName of, DF data frame., , 49, , a), b), c), d), Assertion (A):, , DF.Rename({'Name' : 'SubjectName'}, axis = 1, inplace='True'), DF.rename({'Name' : 'SubjectName'}, axis = 0, inplace='True'), DF.Rename({'Name' : 'SubjectName'}, axis = 0, inplace='True'), DF.rename({'Name' : 'SubjectName'}, axis = 1, inplace='True'), A Data frame is a two-dimensional labelled data structure like a table of MySQL., , Reason (R): It contains rows and columns, and therefore has both a row and column index., Choose the correct option:, a) Both Assertion (A) and Reason (R) are true and Reason (R) is the correct explanation of Assertion, (A), b) Both Assertion (A) and Reason (R) are true but Reason (R) is not the correct explanation of, Assertion (A), c) Assertion (A) is true, but Reason (R) is false., d) Assertion (A) is false, but Reason (R) is true, Section - C, Section C, consists of 6 Question (50 to 55). Attempt any 5 questions., Case Study, 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 “SportsDay” to keep track of the number of First, Second and Third prizes won by different, houses in various events., , 50, , Write Python commands to do the following:, Display the house names where the number of Second Prizes are in the range of 12 to 20., a) df['Name'][(df['Second']>=12) and (df['Second']<=20)], b) df[Name][(df['Second']>=12) & (df['Second']<=20)], c) df['Name'][(df['Second']>=12) & (df['Second']<=20)], IP/065/XII/2021-22, , P a g e | 10
Page 132 :
d) d. df[(df['Second']>=12) & (df['Second']<=20)], 51, , Display all the records in the reverse order., a), b), c), d), , 52, , Display the bottom 3 records, a), b), c), d), , 53, , print(df[::1]), print(df.iloc[::-1]), print(df[-1:]+df[:-1]), print(df.reverse()), , df.last(3), df.bottom(3), df.next(3), d. df.tail(3), , Choose the correct output for the given statements, x=df.columns[:1], print(x), , 54, , a. 0, b. House c. First d. Error, She wants to add a new column with name “Total” in above data frame choose the right command to, do so:, a), b), c), d), , 55, , df['Total']= [“First”] + [“Second”] + [“Third”], df['Total']=df[“First”] + df[“Second”] + df[“Third”], df['Total']= “First” + “Second” + “Third”, d. df['Sum']=[89,78,76], , She wants to delete the row of Ravi house :, a), b), c), d), , df.drop('Ravi', axis=1), df.drop('Ravi', axis=0), df.drop('Ravi', axis=-1), d. df.drop('Ravi', axis==0), , IP/065/XII/2021-22, , P a g e | 11
Page 133 :
1
Page 134 :
2
Page 135 :
3
Page 136 :
4
Page 137 :
5
Page 138 :
6
Page 139 :
7
Page 140 :
8
Page 141 :
9
Page 142 :
10
Page 143 :
11
Page 144 :
12
Page 145 :
13
Page 146 :
14
Page 147 :
15
Page 148 :
16
Page 149 :
1
Page 150 :
2
Page 167 :
KENDRIYA VIDYALAYA SANGATHAN, DELHI REGION, PT- II Marking Scheme (2021-22), Subject: Informatics Practices (Code-065), Class – XII, Note:, ➢ All questions carry equal marks., ➢ No Negative Marking, ➢ Marks will be awarded to maximum 45 questions., Section – A, (Marks will be awarded to maximum 20 questions.), Q1. Answer: c. Pandas, , Q2. Answer: b. patent, Q3. Answer: a., a 14, b 14, c 14, dtype: int64, Q4. Answer: b. Passive digital footprint, Q5. Answer: b., , 1 10, 3 20, 5 30, dtype: int64, Q6. Answer: b. Lineheight, Q7. Answer. a. Phishing, Q8. Answer: d. All are correct, Q9. Answer: a., a 41, e 35, i 29, o 23, u 17, dtype: int64, Q10. Answer: c. columns, Q11. Answer: c. 3, Q12. Answer: d. pyplot, Q13. Answer: a. (2,4), Q14. Answer: c. Both of the above, Q15. Answer: a. Index of the series
Page 170 :
Term-I, Subject: Informatics Practices (Code-065), 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., , Which of the following thing can be data in Pandas?, a) Python Dictionary, b) An ndarray, c) A Scalar value, d) All of the above, , 2. Which of the following data structure is required to analyze data in Pandas, a) Series, b) DataFrame, c) Both of the above, d) None of the above, 3. Which of the following statement is correct for Series?, a) We can create Series from Dictionary in Python., b) Keys of dictionary become index of the series., c) Order of indexes created from Keys may not be in the same order as typed in dictionary., d) All are correct, 4. A DataFrame object can store __________ types of elements., a) Homogenous, b) Heterogeneous, c) Only String, d) None of the above, 5. The axis 0 in a data frame identifies ________ and axis 1 identifies _________., a)Columns, Rows, b)Rows, Columns, c)values, rows, d)ndim, columns, 6. Which of the following is true?, a)If data is an ndarray, index must be the same length as data., b)Series is a one-dimensional labeled array capable of holding any data type., c)Both A and B, d) None of the above, Page1
Page 171 :
7. What is data visualization?, a) It is the numerical representation of information and data, b) It is the graphical representation of information and data, c) It is the character representation of information and data, d) None of the above, 8. Which is a python package used for 2D graphics?, a) matplotlib.pyplot, b) matplotlib.pip, c) matplotlib.numpy, d) matplotlib.plt, , 9. Minimum number of arguments to pass in a pandas Series ______, a)0, b)1, c)2, d)3, 10. To give a title to x-axis, which of the following method is used?, a) pl.xtitle(“title”), b) pl.xlabel(“title”), c) pl.xheader(“title”), d) pl.xlabel.show(“title”), 11. How could you improve your digital footprint?, a) By checking your social media privacy setting to make sure that you are sharing with people you know and trust., b) Share your personal information with a good friend and family member., c) it’s best not to post anything if want to stay safe,, d) its not necessary to think before you post., 12. Knowledge and understanding of netiquette is useful because, a) It will help you create a positive impression on those you meet in cyberspace, b) It explains some of the technical limitations of online communications, c) It explains the conventions already being used by millions of cybernauts., d) All of the above., 13. The free software movement is headed by, a) Free Software foundation, b) Debian free software guidelines., c) Brekely software distribution, d) Open source initiative, , 14. For what purpose pandas is used?, a)To create a GUI programming, b)To create a database, c)To create a high level array, d)All of the above, 15. Which of the following would be creative work protected by copyright:, (a) A list of all Indian President names, (b) A portrait of your family, Page2
Page 172 :
(c) A song you Wrote, (d) The name of your pet dog, 16. Full name of GPL is__________, (a) GNU General Public license, (b) General Public License, (c) General Packet License, (d) All of above, , 17. 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, 18. Person who gains illegal access to computer is known as:, (a) Hacker, (b) Worm, (c) Pirate, (d) Thief, 19. ______ is a 2-D data structure in pandas with row index and column index both., a)Series, b)DataFrame, c)List, d)Tuple, 20. Which of the following element/s is/are cause of e-waste?, a), Lead, b), Cadmium, c), Beryllium, or Brominates flame retardants, d), All of the above, 21. You are planning to go for a vacation. You surfed the internet to get answers for the following queries:, (a) Weather conditions, (b) Availability of air tickets and fares, (c) Places to visit, (d) Best hotel deals, (e) All of these, Which of your above mentioned actions might have created a digital footprint?, 22. Which of the following is not a type of a Cybercrime ?, (a) Data theft, (b) Forgery, (c) Damage to data, (d) Installing Antivirus for Protection, , 23. A DataFrame is _________ mutable and ______ mutable?, a)Row , column, Page3
Page 173 :
b)Row index, column index, c)Size, shape, d)Size, value, 24. In data science which of the python library is more popular?, a)Numpy, b)Pandas, c)Opencv, d)Django, 25. when we create a DataFrame from single series, How many columns it has?, a)1, b)2, c)As many as number of elements in the series, d)None of the above, , Section- B, Section B consists of 24 Questions (26 to 49) . Attempt any 20 questions, , 26. What will be the output of the following code ?, import pandas as p1, s1=p1.Series( [11,12,13,14]), print(s1.index), a. Syntax Error, b. [ 0,1,2,3], c. [ ‘I’,’II’,’III’,’IV’], d. [‘A’,’B’,’C’,’D’], 27. Given are two objects, a list object namely lst1 and a series object namely ser1, both are having similar, values i.e. 2,4,6,8. Find out the output produced by following statements:, print(lst1*2), print(ser1*2), a. [2,4,6,8,2,4,6,8] 1. 4, 2. 8, 3. 12, 4. 16, b. [4,8,12,16] 1 2, 24, 36, 48, 52, 64, 76, 88, 28. What will be the output of following codeimport pandas as pd, s1=pd.Series([1, 2, 2, 7, ’Sachin’, 77.5]), print(s1.head()), Page4
Page 174 :
a. Last data elements of series along with its indices i.e. -1., b. First data element of series along with its indices i.e. 0., c. Entire series, d. First five data elements of series along with its indices i.e. 0,1,2,3,4 respectively, 29. Ravi has to prepare a project report on “Chemicals”. He decides to take information from the internet., He downloads those webpages containing information on ‘Chemicals’. Which of the following steps taken, by Ravi is/are an example of plagiarism?, a)He read a paragraph and rewrite it in his own words and used in his project., b) He downloaded different images and after making a collage paste in his report., c) He downloaded a power point presentation from website and named it as his own., d) All of the above., 30 Observe the output figure. Identify the coding for obtaining this output., , a) import matplotlib.pyplot as plt, plt.plot([1,2],[4,5]), plt.show(), b) import matplotlib.pyplot as plt, plt.plot([2,3],[5,1]), plt.show(), c) import matplotlib.pyplot as plt, plt.plot([1,2,3],[4,5,1]), plt.show(), d) import matplotlib.pyplot as plt, plt.plot([1,3],[4,1]), plt.show(), 31. Choose correct option :, D1={ ’A’:’CS’, ‘B’:’IP’}, D2={ ’B’:’IP’, ‘A’:’CS’}, Statement 1: Output of print (D1==D2) is True., Statement 2: Dictionary is a collection of key-value pairs. It is not a sequence., a. Only Statement 1 is true., b. Only Statement 2 is true., c. Both Statement 1 and 2 are true, but Statement 2 is not correct reasoning of Statement 1., d. Both Statement 1 and 2 are true, but Statement 2 is correct reasoning of Statement 1., , 32. Identify the right type of chart using the following hints., Hint 1: This chart is often used to visualize a trend in data over intervals of time., Hint 2: The line in this type of chart is often drawn chronologically., a) Line chart, b) Bar chart, Page5
Page 175 :
c) Pie chart, d) Scatter plot, 33. A software company purchases new computers every year and dumps the old ones into the local, dumping yard . Write the name of the most appropriate category of waste that the organization is creating, every year out of the following options :, i, (i) Business waste, ii, (ii) Commercial waste, iii, (iii) Solid waste, iv, (iv) E-waste, , 34. Choose the correct code for the following statements being correct or incorrect., Statement I: Intellectual Property is a category of property that includes intangible creations of the human, intellect., Statement II: IPR does not include trade secrets and moral rights., a) Both the Statements I and II are correct., b) Both the Statements I and II are incorrect., c) Statement I is correct ,but II is incorrect., d) Statement II is correct ,but I is correct., 35. Consider the following series named s1 has given values and index, Index, Elemennts, I, 15, II, 20, III, 25, IV, 30, Then write the output of the command s1>20, a), Index, Elements, I, False, II, False, III, True, IV, True, b), Index, III, IV, , Elements, 25, 30, c), , Index, II, III, IV, , Elements, 20, 25, 30, , d. None of the above, 36. Rita is reciving threatening emails from some unknown sender repeatedly. What should she do?, (a) Inform parents, teacher and go to Police station with parents., (b) Ignore them, (c) Keep silent and not tell anybody about it, (d) Follow the instructions of the sender, Page6
Page 177 :
43. Given two Series created using below given statements :, import pandas as pd, ds1 = pd.Series([2, 4, 6, 8, 10]), ds2 = pd.Series([1, 3, 5, 7, 9]), choose the correct statement to find the product of ds1 and ds2., a. print(ds1 x ds2), b. print(product(ds1,ds2)), c. print(ds1 ** ds2), d. print(ds1 * ds2), 44. Predict the output of the following code segment from the available options:, import pandas as pd, f1=pd.DataFrame([5,6,7]), f2=pd.DataFrame([5,6,7],index=[‘five’,’six’,’seven’]), print("Frame 1"), print(f1), print("Frame 2"), print(f2)., , Page8
Page 178 :
45. A legal right created by the law of a country that grants the creator of an original work exclusive rights, for its use and distribution is called, a) Copyright, b) Invention, c) Backup, d) Worm, 46. Consider the following dataframe dtf then What will be the possible output of the statement :, dtf.shape, , a. (4,3), b. (3,4), Page9
Page 179 :
c. 4,3, d. (4,4), 47. Which method is used to read the csv file content into data frame?, a. read_csv(), b. readcsv(), c. reading_csv(), d. Read_CSV(), 48. Write down the command that will give the following output :EMPID DESIGNATION SALARY, 0, E01, PRT, 30000, 1, E02, PGT, 60000, 2, E03, TGT, 45000, a. edf.Head(row=3), b. edf.head(3 ), c. edf.head(2), d. edf.Head(3), , 49. Choose correct option :, Reena created a series s1 having data elements as 12, 13, 14, 15 with index as I1, I2, I3,I4 respectively. She, is using code either s1.loc [‘I2’:’I3’] or s1.iloc[1:3], Statement 1: Both code will give identical output., Statement 2: Both codes can be used to access data elements as 13,14,15 respectively., a. Only Statement 1 is true., b. Only Statement 2 is true., c. Both Statement 1 and 2 are true, but Statement 2 is not correct reasoning of Statement 1., d. Both Statement 1 and 2 are true, but Statement 2 is correct reasoning of Statement 1., , Section –C, Section C consists of 6 Question(50 to 55). Attempt any 5 questions, Case Study, 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, “SportsDay” to keep track of the number of First, Second and Third prizes won by different houses in, various events., , Based on the given information , answer the questions No. 50-55, Page10
Page 180 :
50. Write Python commands to Display the house names where the number of Second Prizes are in the, range of 12 to 20., a. df['Name'][(df['Second']>=12) and (df['Second']<=20)], b. df[Name][(df['Second']>=12) & (df['Second']<=20)], c. df['Name'][(df['Second']>=12) & (df['Second']<=20)], d. df[(df['Second']>=12) & (df['Second']<=20)], 51., Write Python commands to Display all the records in the reverse order., a. print(df[::1]), b. print(df.iloc[::-1]), c. print(df[-1:]+df[:-1]), d. print(df.reverse()), 52. Display the bottom 3 records, a. df.last(3), b. df.bottom(3), c. df.next(3), 53. Choose the correct output for the given statements, x=df.columns[:1], print(x), a. 0, b. Name, c. First, d. Error, 54. Which command will give the output 24:, a. print(df.size), b. print(df.shape), c. print(df.index), d. print(df.axes), 55. What will be the answer of df.shape() command, a.(4,6), b(6,4), c(5,4), d(4,5), , Page11
Page 182 :
ANSWER KEY --PRE TERM-I, Subject: Informatics Practices, Class–XII, 1, 2, 3, 4, , d, c, a, , 5, 6, 7, 8, 9, 10, , a, d, , 11, 12, 13, , b, d, , 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, , b, , b, c, d, c, , c, c, c, c, c, a, b, a, b, , a, a, b., , 25, , a., , 26, , d, , 27, , c, , 28, , a, a, , 29, 30, 32, , b, d, c, , 33, , c, , 34, , c, , 35, , a, , 36, , d, , 37, , c, , 38, , a, , 39, , a, , 40, , b, , 31
Page 183 :
41, 42, , d, a, , 43, , b, , 44, 45, , a, d, , 46, , a, , 47, , c, , 48, , a, , 49, 50, , a, c, , 51, 52, 53, 54, 55, , b, d, c, a, d