Get total of Pandas column
You should use sum: Total = df[‘MyColumn’].sum() print(Total) 319 Then you use loc with Series, in that case the index should be set as the same as the specific column you need to sum: df.loc[‘Total’] = pd.Series(df[‘MyColumn’].sum(), index=[‘MyColumn’]) print(df) X MyColumn Y Z 0 A 84.0 13.0 69.0 1 B 76.0 77.0 127.0 2 C … Read more