df = pd.DataFrame({'A': np.random.randn(5), 'B': np.random.randn(5)})
sum_row = {col: df[col].sum() for col in df}
sum_df = pd.DataFrame(sum_row, index=['Total'])
df = df.append(sum_df)
Appending column totals to a Pandas DataFrame