导入数据
import pandas as pd
df = pd.DataFrame(data={'orders': [2130,5102,3256,1297,1918,786],
'repeat_orders': [73,158,89,30,49,18]})
df
df['repetition_rate']= df['repeat_orders'] / df['orders']
df
df['repetition_rate'] = df['repetition_rate'].apply(lambda x: format(x, '.2%'))
df