df = pd.DataFrame(np.abs(randn(3, 4)), index=[1, 2, 3], columns=['A', 'B',
    'C', 'D'])
df.divide(df.sum(axis=1), axis=0)
pandas dataframe create new columns and fill with calculated values from same df