Page 39 - Informatics_Practices_Fliipbook_Class12
P. 39
output of the above code is:
0 1000
1 8000
dtype: int64
What is the correct statement for the above output in the following statement-1?
a. d=L*3 b. data=L**3 c. L*3 d. [10,20]**3
Ans. b. data=L**3
7. Which attribute is used with Series to count the total number of NaN values? [2022]
a. size b. len c. count d. count total
Ans. c. count
8. What will be the output of the following code? [2022]
import pandas as pd
import numpy
s=pd.Series (data=[31,54,34,89,12,23],dtype=numpy.int)
print(s>50)
(a) (b) (c) (d)
0 False 1 54 0 31 1 True
1 True 3 89 1 54 3 True
2 False dtype:int64 2 34 dtype:bool
3 True 3 89
4 False 4 12
5 False 5 23
dtype: bool dtype: int64
Ans. (d)
1 True
3 True
dtype:bool
9. Consider the following Series in Python: [2022]
data = pd.Series([5, 2, 3,7), index=['a', 'b', 'c', 'd'])
Which statement will display all odd values
a. print(data%2==0)
b. print(data(data%2 ! = 0))
c. print(data mod 2! = 0)
d. print(data[data%2!=0])
Ans. d. print(data[data%2!=0])
Data Handling using Pandas 25

