Suppose the data is as follows
import pandas as pd
data = {'Sub_Id': ['SM01', 'SM02', 'SM03'], 'Sub_name': ['English', 'Physics', 'Maths'], 'Marks': ['62', '33', '86']}
table = pd.DataFrame(data)
print(table)
and the output is
Sub_Id Sub_name Marks
0 SM01 English 62
1 SM02 Physics 33
2 SM03 Maths 86
I want to add an extra row which will give output as
Sub_Id Sub_name Marks
0 SM01 English 62
1 SM02 Physics 33
2 SM03 Maths 86
3 Total_marks 181
Here the 4th row 1st element Total_marks
is common to both Sub_Id
and Sub_name
Is this possible through pandas or tabulate or Tableit?