1. import pandas as pd
d = {
'1': 'Alice',
'2': 'Bob',
'3': 'Rita',
'4': 'Molly',
'5': 'Ryan'
}
S = pd.Series(d)
In the above python code, the keys of the dictionary d represent student ranks and the value for each key is a student name. Which of the following can be used to extract rows with student ranks that are lower than or equal to 3?
A. S.loc[0:2]
B. S.loc[0:3]
C. S.iloc[0:3]
D. S,ilo[0:2]
Comments
Leave a comment