Format certain floating dataframe columns into percentage in pandas
The accepted answer suggests to modify the raw data for presentation purposes, something you generally do not want. Imagine you need to make further analyses with these columns and you need the precision you lost with rounding. You can modify the formatting of individual columns in data frames, in your case: output = df.to_string(formatters={ ‘var1’: … Read more