-1

I need create a new row with the total value of axis 0 sum.

I have the follow series values:

INDEX
0      -1.09
1       1.15
2      -0.28
3      -0.14
4       0.62

How can i add a new row at the end of series with the total sum, like this:

INDEX
0      -1.09
1       1.15
2      -0.28
3      -0.14
4       0.62
TOTAL   0.26
Matheus
  • 150
  • 10

2 Answers2

3

You should find your answer here :

Appending column totals to a Pandas DataFrame

Precisely : df.loc['Total']= df.sum()

mouch
  • 37
  • 3
0
df.set_value('TOTAL',df.sum())
VinceP
  • 2,058
  • 2
  • 19
  • 29