for row in df.iterrows()]).reset_index() code example Example: pandas for loop after loc reset_index df.reset_index(inplace=True)