In the line
Looking at
exercises = df.loc[ix_mg[0][1]].at[m_g[ix_mg[0][0]]]Look at this part
m_g[ix_mg[0][0]]Not used pandas in a while is that a valid input for at?
Looking at
https://pandas.pydata.org/docs/reference...me.at.html Wrote:Get value within a SeriesThis seems like what you are doing so ignore me
df.loc[5].at['B']