PY
py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# import pandas as pd
# data = {
# 'name': ['James', 'Billy', 'Bob', 'Amy', 'Tom', 'Harry'],
# 'rank': [4, 1, 3, 5, 2, 6]
# }
'''You need to take a rank as input and
output the corresponding name column
from the DataFrame as a Series.
'''
'''you have misunderstood the rank thing.
lemme tell you that James is ranked 4th, billy is ranked 1st,
Bob has rank 3, Amy 5th, Tom 2nd and Harry 6th'''
# rank = int(input())
# df = pd.DataFrame(data, index=data['name'])
# y = df['name']
# print(y.iloc[rank-1])
'''One coincidence has made it more difficult for you
to see the flaw in your logic.
First lemme explain what your code is doing.
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run