I have a data frame similar to this one
GRP HOST1 HOST2 HOST3 FILESIZE
0 0 srv39 srv45 srv47 203498176
1 1 srv102 srv36 srv38 452763956
2 1 srv101 srv36 srv45 453277268
3 1 srv101 srv34 srv45 448174741
4 1 srv36 srv49 srv50 452728577
5 2 srv100 srv47 srv48 454617541
6 2 srv100 srv45 srv49 454617541
7 2 srv38 srv49 srv47 454617541
Now what I would like to achieve is count all occurrences that I have across HOST1 HOST2 and HOST3 column grouped by the GRP column, like this
--
GRP HOST count
1 srv101 2
srv36 3
It would be perfect if I would be able to sum the value of the FILESIZE column.
I was trying to shape a solution using suggestions that I have found here, but I have not been able to get the count grouped by GRP.
Any suggestion about which would be the best approach to obtain the results that I need with pandas?