how to assign a calculated column to a column in pandas dataframe code example Example: pandas create a calculated column df['A_perc'] = df['A']/df['sum']