Q6. Find the Error:


data = np.array(['a', 'b', 'c', 'd', 'e', 'f'])

S = pd. Series(data, index = [100, 101, 102, 103, 104, 105])

print(s[102, 103, 104])


Can you correct the error ?


Answer =

error :-  3 index given at same time

Correction :-

print(s.loc[102:104])

5 Comments

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

Post a Comment

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

Previous Post Next Post