Q. Consider the same Series object, S, given in the previous question. What output will be produced by following code fragment?
S.index = ['AMZN', 'AAPL', 'MSFT', ‘GOOG’]
print(S)
print(S['AMZN'])
S['AMZN'] = 1.5
print( S['AMZN'])
print(S)
Answer =
Output:-
AMZN 0.430271
AAPL 0.617328
MSFT -0.265421
GOOG -0.836113
dtype: float64
0.430271
1.5
AMZN 1.500000
AAPL 0.617328
MSFT -0.265421
GOOG -0.836113
dtype: float64
Post a Comment
You can help us by Clicking on ads. ^_^
Please do not send spam comment : )