Home »
Python »
Python Pandas MCQs
During the execution of following code, what will be the response, we get –
8. During the execution of following code, what will be the response, we get -
import pandas as pd
s =pd.Series([1,2,3,4,5],index= ['a','b','c','d','e'])
print(s['f'])
- KeyError
- IndexError
- ValueError
- None of the above mentioned
Answer: A) KeyError
Explanation:
We will get "KeyError" during the execution of above mentioned code.