It's pretty simple.Create a DataFrame as usual and i would append the last three rows with information in first column and empty spaces in the last. Then i would write my file to excel using to_csv. You can read more about it here: Writing DataFrame to Excel.
Here's the code:
import pandas as pd
my_data={'A':["2017/01/14","2017/01/02"],'M':['C','C'],'P':[8,7],'G':[1.44,1.26],'R':[0.8,0.7],'N':[2,8]}
df=pd.DataFrame(my_data)
#Add the extra rows
df.loc[-1]=['Total M: ',' ',' ',' ',' ',' ']
df.index=df.index+1
df.loc[-1]=['Total G: ',' ',' ',' ',' ',' ']
df.index=df.index+1
df.loc[-1]=['Total R: ',' ',' ',' ',' ',' ']
#Write to excel
df.to_csv('FileName',sep='\t',encoding='utf-8',index=False)
From next time, it would be appreciated if you post what you have tried.
Good Luck!
May the CODE be with you!