CBSE Class 12 Informatics Practices
Question 112 of 167
Python Pandas — I — Question 2
Back to all questionsAMZN 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
The provided code fragment first changes the index labels of the Series S to ['AMZN', 'AAPL', 'MSFT', 'GOOG'], prints the modified Series S, and then proceeds to print and modify the value corresponding to the 'AMZN' index. Specifically, it prints the value at the 'AMZN' index before and after assigning a new value of 1.5 to that index. Finally, it prints the Series S again, showing the updated value at the 'AMZN' index.