I need to change floats to % values in a loop. The problem is when I try this, in the second value of the loop the original data changes to str instead of a float.
for item in correccion_kpis:
status_general.loc[status_general[header_tracker_KPI] == item, \
header_final_kpi] = (status_general[header_final_kpi] * 100).map('{:,.2f}%'.format)
status_general.loc[status_general[header_tracker_KPI] == item, \
header_tracker_KPI_Objetivo] = status_general[header_tracker_KPI_Objetivo].map('{:,.2f}%'.format)
status_general.loc[status_general[header_tracker_KPI] == item, \
header_final_kpi_dia_anterior] = (status_general[header_final_kpi_dia_anterior] * 100).map('{:,.2f}%'.format)
error: ValueError: Unknown format code 'f' for object of type 'str'