import pandas as pd
nums = pd.Series([1, 3, 7, 12, 88, 23, 3, 1, 9, 0])
print("Original Series:")
print(nums)
print("Index of the first occurrence of the smallest and largest value of the said series:")
print(nums.idxmin())
print(nums.idxmax())
Sample Output:
Original Series:
0 1
1 3
2 7
3 12
4 88
5 23
6 3
7 1
8 9
9 0
dtype: int64
Index of the first occurrence of the smallest and largest value of the said series:
9
4
Sample Output:
need an explanation for this answer? contact us directly to get an explanation for this answer