Pandas Quiz 11

Share with others

Welcome to your Pandas Quiz 11

Q101. Can a Series have duplicate index value?

Q102. Rosy wants to display the series 'S1' in reverse order. Help her to find the correct code.

Q103. Number of students in each section of class 9th is stored in series 'S1'. Write a statement to change the value of section 'A' and 'B' to 50.

A      41
B      44
C      40
D      42
E      47

Q104. head( ) function return ___________ n rows and tail function return ___________ n rows from a pandas object.

Q105. Series 'S1' has five values with index value (0, 1, 2, 3, 4) and series 'S2' has five values with index (2, 3, 4, 5, 6). What will be the total number of values in 'S3' if S3 = S1 + S2

Q106. Raman performed addition of series 'S1' and 'S2' and store the result in series 'S3'. Both the series 'S1' and 'S2' have five mismatching index value. How many NaN will be there in 'S3'?

Q107. Which of the following statement return Boolean result?

import pandas as pd
S1=pd.Series([11, 12, 5, 6,9])
print(S1) #Statement 1
print(S1>7) #Statement 2
print(S1[S1>7]) #Statement 3

Q108. Which of the following statement return Filtered result?

import pandas as pd
S1=pd.Series([11, 12, 5, 6,9])
print(S1) #Statement 1
print(S1>7) #Statement 2
print(S1[S1>7]) #Statement 3

Q109. Amit is working in an IT firm as Data Manager. He stored the salary of all employees in Series named "Empser". His Boss asked him to filter the employees whose salary is more than 20000. Help him to find the correct code. Sample of data stored is shown below.

0      25000
1     20000
2      21000
3      30000

Q110. ___________ function is used to sort a Series object on the basis of values.


Share with others

Leave a Reply

error: Content is protected !!