I have a csv file and there are Date, count, and service column. There are many date,count and service columns but this is the example I will write below.
Number Count Service Number Count service
0 13 NO SERVICE 0 10
1 14 tcpmux 1 10
2 9 compressnet 2 14
So I want the answer like :
Number Total Count Service
0 23 NO SERVICE
1 24 tcpmux
2 23 compressnet
How do I do the code in pandas
import pandas as pd
df =pd.read_csv ("/Users/mani/Desktop/monthly report/geoip/2017-20dstipsum12.csv")
hasil = df.groupby(['NUMBER']).sum()
hasil.to_csv('gotttt.txt', sep='\t', encoding='utf-8')