df.groupby(["segment", "group", "date"]).sum().reset_index()
# output
segment group date actual
0 A a 21-Jun 8
1 A b 21-Jul 7
2 A c 21-Aug 8
3 B e 21-Sep 10
4 C d 21-Nov 7
5 C f 22-Jan 7
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.