0% found this document useful (0 votes)
13 views

Class 12 IP Practice Assignment Series 2

Uploaded by

Bhavya Bhatt
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views

Class 12 IP Practice Assignment Series 2

Uploaded by

Bhavya Bhatt
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Write following MCQ Question Answer in your Notebook datewise.

Series-2
Revision Practice MCQ Unsolved Questions 07-09-2021
Class 12
Topic- Pandas DataFrame Creation, Basic Details, Show Columns
Subject IP
Q1. Select the correct points of Pandas DataFrame:-
1. DataFrame is like a one-dimensional array like structure.
2. DataFrame is like a two-dimensional array like structure.
3. DataFrame hold homogeneous data.
4. DataFrame hold heterogeneous data.
5. DataFrame Size Immutable But Values of DataFrame Mutable.
6. DataFrame Size mutable(editable) and also Values of DataFrame mutable (editable).
a. 2, 4, 6 b. 1, 3, 5 c. All correct d. All incorrect

Q2. Which library you will use to create a pandas dataframe.


a. import numpy as np
b. import matplotlib.pyplot as plt
c. import pandas as pd

Q3. Select the incorrect statement of python dataframe library:


a. import pandas as pd
b. import pandas as pd1
c. import pandas as 2pd

Q4. To create following emp dataframe, so select correct python code for this:-
emp
eid ename eheight
0 e1 john 25
1 e2 smith 30
2 e3 peter 22
import pandas as pd
a. emp=DataFrame(,‘eid’:*‘e1’, ‘e2’, ‘e3’+, ‘ename’ : *‘john’,’smith’,’peter’+, ‘eheight’:*25,30,22+-)
b. emp=pd.dataframe(,‘eid’:*‘e1’, ‘e2’, ‘e3’+, ‘ename’ : *‘john’,’smith’,’peter’+, ‘eheight’:*25,30,22+-)
c. emp=pd.DataFrame(,‘eid’:*‘e1’, ‘e2’, ‘e3’+, ‘ename’ : *‘john’,’smith’,’peter’+, ‘eheight’:*25,30,22+-)

Q5. To display above emp dataframe, so select correct python code for this:-
a. print(employee)
b. print(emp)
c. print(emp())

Q6. To display only ‘eid’ column of above emp dataframe, so select correct python code for this:-
a. print(emp.’eid’)
b. print(emp.eid)
c. print(eid)

Q7. To display only ‘eid’ column of above emp dataframe, so select correct python code for this:-
a. print(emp*‘eid’+)
b. print(emp.’eid’)
c. print(eid)

Q8. To display only ‘eid’ column of above emp dataframe, so select correct python code for this:-
a. print(employee.loc* : , ‘eid’+)
b. print(employee.’eid’)
c. print(eid)

Q9. To display only ‘eid’ column of above emp dataframe, so select correct python code for this:-
a. print(iloc[ : , 0])
b. print(emp.iloc[ : , 0])
c. print(eid)

Q10. To display only ‘ename’ column of above emp dataframe, so select correct python code for this:-
a. print(emp.loc* : , ‘ename’+)
b. print(emp.iloc[ : , 1])
c. print(emp.ename)
d. print(emp*‘ename’+)
e. All will display only ename column of emp dataframe

Q11. To display only ‘eheight’ column of above emp dataframe, so select correct python code for this:-
a. print(emp.loc* : , ‘eheight’+)
b. print(emp.iloc[ : , 2])
c. print(emp.eheight)
d. print(emp*‘eheight’+)
e. All will display only eheight column of emp dataframe

Q12. To display above emp dataframe, so select correct python code for this:-
a. print(emp.loc[ : , : ])
b. print(emp.iloc[ : , : ])
c. print(emp)
d. print(emp.values)
e. All will display emp dataframe

Q13. To display only ‘eid’ column of above emp dataframe, so select correct python code for this:-
a. print(emp.loc* : , ‘eid’+)
b. print(emp.iloc[ : , 0])
c. print(emp.eid)
d. print(emp*‘eid’+)
e. All will display only eid column of emp dataframe

Q14. Select the correct output of following python code:


print(emp.dtypes)
a.
eid ename eheight
0 e1 john 25
1 e2 smith 30
2 e3 peter 22

b.
Name: eid, dtype: object
eid object
ename object
eheight int64
dtype: object

Q15. Select the correct output of following python code:


print(emp.max())
a.
eid e3
ename smith
eheight 30

b.
eid e1
ename john
eheight 22

Q16. Select the correct output of following python code:


print(emp.min())
a.
eid e3
ename smith
eheight 30

b.
eid e1
ename john
eheight 22

Q17. Select the correct output of following python code:


print(emp.ndim)
a. 1 b. 2

Q18. Select the correct output of following python code:


print(emp.size)
a. 9 b. (3, 3)

Q19. Select the correct output of following python code:


print(emp.shape)
a. 9 b. (3, 3)

Q20. Select the correct output of following python code:


print(emp.sum())
a.
eheight 77

b.
eid e1e2e3
ename johnsmithpeter
eheight 77

Q21. Select the correct output of following python code:


print(emp.mean())
a. It will give error. It is not possible.

b. No, It will display result of only numeric column mean ,here eheight mean will display.

Q22. Select the correct output of following python code:


print(emp.median())
a. It will give error. It is not possible.

b. No, It will display result of only numeric column median ,here eheight median will display.

Q23. Select the correct output of following python code:


print(emp.describe())
a.
eheight
count 3.000000
mean 25.666667
std 4.041452
min 22.000000
25% 23.500000
50% 25.000000
75% 27.500000
max 30.000000

b.
Name: eid, dtype: object
eid object
ename object
eheight int64
dtype: object

Q24. To display sum (77) of eheight column of emp dataframe, what are the alternate code for this.
a. print(emp.eheight.sum())
b. print(emp.loc[ : , 'eheight'].sum())
c. print(emp.iloc[ : , 2].sum())
d. print(emp.eheight.sum())
e. print(emp['eheight'].sum())
f. All above code will display sum of eheight column of emp dataframe without any error.

Q25. To display maximum eheight (30) value of emp dataframe, what are the alternate code for this.
a. print(emp.eheight.max())
b. print(emp.loc[ : , 'eheight'].max())
c. print(emp.iloc[ : , 2].max())
d. print(emp.eheight.max())
e. print(emp['eheight'].max())
f. All above code will display maximum eheight column of emp dataframe without any error.

Previous MCQ Question pdf file

Date Pdf file link


06-09-2021 Class 12 IP Practice Assignment Series 1

You might also like