Вы можете использовать pandas.Index.map
:
import pandas as pd
from math import sqrt
df = pd.DataFrame({'col1': (1,2,3), 'col2': (3,4,6),}, index=[1,4,9])
df
Out:
col1 col2
1 1 3
4 2 4
9 3 6
mapped_index = df.index.map(sqrt)
mapped_index
Out:
Float64Index([1.0, 2.0, 3.0], dtype='float64')
Затем, если вам нужно, вы можете просто перебрать результат:
for i in df.index.map(sqrt):
....