You are on page 1of 9

PRACTICE PAPER(TERM-1)

CLASS XII
SUBJECT- INFORMATICS PRACTICES(065)
TIME:45 Min MM:25
1. The command to install the pandas is: [1]
a) install pip pandas
b) install pandas
c) pip pandas
d) pip install pandas

2. Which of the following is not Pandas data structure? [1]


a) Series
b) Data Frame
c) Queue
d) Panel

3. Pandas mainly used for [1]


a) Data Recovery
b) Data Backup
c) Data Visualization
d) Data Analysis

4. Find output [1]


import pandas as pd
vacine=pd.Series(['Covaxin','SputnikV','Pfizer','Abdala'],
index=['India','Rusia','Germany','Cuba'])
print (vacine[[3,2]])

a) Error
b) Cuba Abdala
Germany Pfizer
c) Germany Pfizer
Rusia SputnikV
d) Germany Pfizer
Rusia SputnikV

5. Find output [1]


import pandas as pd
L1=[10,20,33,42]
L2=['pen','pencil','eraser','sharpner']
shop=pd.Series(L1,index=L2)
print((shop>20))

a) pen False
pencil False
eraser True
sharpner True
dtype: bool

b) eraser 33
sharpner 42
dtype: int64

c) Error

d) 10 True
20 True
33 True
42 True

6. Identify the correct output for: [1]


import pandas as pd
list1=[1,2,3,4,5,6,7,8]
list2=['swimming','tt','skating','kho kho', 'bb', 'chess', 'football',"cricket"]
school=pd.Series(list1,index=list2)
print (school[2:4])

a) skating 3
kho kho 4

b) tt 2
skating 3
kho kho 4

c) skating 3
kho kho 4
bb 5
d) skating 3
kho kho 4
bb 5
chess 6
football 7
cricket 8

7. Choose the correct match from the given two columns [1]
Column A Column B
A 1.
import pandas as pd com [90, 70, 60, 50]
d = {"com": [90,70,60,50], "english":[89,99,95,45], "eco":[34,45,67,97]} english [89, 99, 95, 45]
s = pd.DataFrame(d) eco [34, 45, 67, 97]
print(s)

B 2.
import pandas as pd com english eco
d ={'c1':{"com":90,"english":89,"eco":34},'c2':{"com":70,"english":99,"eco":45}, 0 90 89 34
'c3':{"com":60,"english":95,"eco":67},'c4':{"com":50,"english":45,"eco":97}} 1 70 99 45
s = pd.DataFrame(d) 2 60 95 67
print(s) 3 50 45 97

C 3.
import pandas as pd c1 c2 c3 c4
import pandas as pd com 90 70 60 50
d = {"com": [90,70,60,50], "english":[89,99,95,45], "eco":[34,45,67,97]} english 89 99 95 45
s = pd.DataFrame(d,index=['c1','c2','c3','c4']) eco 34 45 67 97
print(s))

D 4.
import pandas as pd com english eco
d= {"com": [90,70,60,50], "english":[89,99,95,45], "eco":[34,45,67,97]} c1 90 89 34
s=pd.Series(d) c2 70 99 45
print(s) c3 60 95 67
c4 50 45 97

a) A-1, B-2, C-3, D-4


b) A-4, B-3, C-1, D-2
c) A-2, B-3, C-4, D-1
d) A-1, B-3, C-4 ,D-2

8. What will be the output of following code: [1]


import pandas as pd
dt=({'Name':['Aman','raman','raj','avi','savi'],'Unit1':[18,19,20,18,19],
'Unit2':[76,78,80,76,73]})
df=pd.DataFrame(dt)
print(df.iloc[0:2,0:2])

a) Name Unit1 Unit2


0 Aman 18 76
1 raman 19 78
2 raj 20 80

b) Name Unit2
0 Aman 76
2 raj 80

c) Name Unit2
0 Aman 76
1 raman 78
2 raj 80

d) Name Unit1
0 Aman 18
1 raman 19

9. To change the 3th column's value at 2rd row as 95 in data frame, S you
can write [1]
a) S.at[1,2]=95
b) S[1,2]=95
c) S.iat[1,2]=95
d) S.iat[2,3]=95

10. To delete a row from a DataFrame, you may use [1]


a) remove
b) del
c) drop
d) cancel
11. [1]

For the above Data Frame following statement is give error:


d[discount]=d[cost]*10/100
Find and correct the error
a) d["discount"]=d[‘cost’]*10/100
b) d[discount]=d["cost"]*10/100
c) d["discount"]=d[cost]*10/100
d) d["discount"]=d[“cost”*10/100]

12. What is true about India’s IT Act and IT (Amendment) Act? [1]
Statement 1: IT Act 2000 provided legal recognition to electronic
commerce
Statement 2: IT (Amendment) Act 2008 provided additional focus on
information security
a) Both Statements 1 and 2 are True
b) Statement 1 is True but Statement 2 is False
c) Both Statements 1 and 2 are False
d) Statement 1 is False but Statement 2 is True

13. Mr. Mohan is a business man His laptop was controlled by somebody in
an unauthorized way Identify the type of crime happened to him? [1]
a) Phishing
b) Cyber Trolls
c) Hacking
d) Cyber Bullying

14. Which of the following are not contributors of e-waste in the world? [1]
a) Refrigerators/freezers, washing machines, dishwashers
b) Personal computers, mobile phones
c) Gas cylinder
d) Televisions
15. ____ gives you right to exclude others from making, selling, using
or importing a particular product or service. [1]
a) Trademark
b) Patent
c) Copyright
d) Plagiarism

16. The practice of sending fraudulent communications that appear to [1]


come from a reputable source. It is usually done through email. The goal
is to steal sensitive data like credit card and login information.
a) Bullying
b) Plagiarism
c) Phishing.
d) Licensing

17. Firewalls are used to protect against -------- [1]


a) data driven attacks
b) fire attacks
c) virus attacks
d) unauthorized access

18. Method use to give heading to the graph is___ [1]


a) plot()
b) show()
c) title()
d) xlabel()

19. The command used to save plotted graph using pyplot function is__ [1]
a) matplotlib.pyplot.save()
b) matplotlib.pyplot.savefig()
c) matplotlib.pyplot.savepicture()
d) matplotlib.pyplot.saveimage()

20. Which of the following statements will create a given chart with [1]
city and corresponding total number of sales of BMW cars
a) import matplotlib.pyplot as plt
sales= {"lko": 200,"delhi":250, "bombay":380, "punjab":164,"hariyana":60}
city=sales.keys()
quantity=sales.values()
plt.plot(city,quantity)
plt.show()

b) import matplotlib.pyplot as plt


sales= {"lko": 200,"delhi":250, "bombay":380, "punjab":164,"hariyana":60}
city=sales.keys()
quantity=sales.values()
plt.barh(city,quantity)
plt.show()

c) import matplotlib.pyplot as plt


sales= {"lko": 200,"delhi":250, "bombay":380, "punjab":164,"hariyana":60}
city=sales.keys()
quantity=sales.values()
plt.bar(quantity,city)
plt.show()

d) import matplotlib.pyplot as plt


sales= {"lko": 200,"delhi":250, "bombay":380, "punjab":164,"hariyana":60}
city=sales.keys()
quantity=sales.values()
plt.bar(city,quantity)
plt.show()

CASE STUDY

Mr. Ankit is working in an organization as data analyst. He got a dataset


of the passengers for the year 2010 to 2012. 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 pd
data={"Year":[2010,2010,2012,2010,2012],"Month":["Jan","Mar","Jan",
"Dec", "Dec"] ,"Passengers":[25,50,35,55,65]}
df=pd.DataFrame(data)
print(df)
Based on the above information, answer the questions from 21 to 25
21. He wants to print the details of "January" month along with the [1]
Number of passengers, Identify the correct statement:

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

22. Choose the correct statement/ method for the required output: (5,3) [1]
a) df.index
b) df.shape()
c) df.shape
d) df.size

23. He wants to change the index of the Data Frame Identify the correct [1]
statement to change the index.

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"]
24. He want to see 2 rows from the top in the dataframe, which of the [1]
following statement is correct:
a) df.head()=2
b) df.head(n=2)
c) df.head(range(2))
d) All of the above

25. Which of the following code will print Year and Passenger? [1]
a) df.loc[:,df.columns!='Month']
b) df.loc[:,'Year':'Passengers']
c) df.loc['Year':'Passengers']
d) All of the above

You might also like