I'm working with a data frame and it is formatted as follows:
Instrument | Date | Time | MilliSecond | Volume
--------------------------------------------------------------
ABC | 5/20/2012 | 10:30:20 | 205 | 123
--------------------------------------------------------------
ABC | 5/20/2012 | 10:30:20 | 205 | 456
--------------------------------------------------------------
ABC | 5/20/2012 | 10:30:20 | 205 | 789
--------------------------------------------------------------
ABC | 5/20/2012 | 10:31:12 | 329 | 150
--------------------------------------------------------------
ABC | 5/20/2012 | 10:31:12 | 329 | 430
--------------------------------------------------------------
DEF | 5/20/2012 | 10:32:40 | 430 | 58
--------------------------------------------------------------
DEF | 5/20/2012 | 10:32:40 | 430 | 164
--------------------------------------------------------------
GHI | 5/20/2012 | 10:33:27 | 531 | 762
--------------------------------------------------------------
What I'd like to do is sum the values in the Volume column based on the Instrument, the Date, the Time, and the Millisecond columns so that I am able to get a data frame that looks like this:
Instrument | Date | Time | MilliSecond | Volume
--------------------------------------------------------------
ABC | 5/20/2012 | 10:30:20 | 205 | 1368
--------------------------------------------------------------
ABC | 5/20/2012 | 10:31:12 | 329 | 580
--------------------------------------------------------------
DEF | 5/20/2012 | 10:32:40 | 430 | 222
--------------------------------------------------------------
GHI | 5/20/2012 | 10:33:27 | 531 | 762
--------------------------------------------------------------
(To put it simply, if the Instrument, Date, Time, and MilliSecond column are the same for several rows, I would like to sum the Volume and then put it all into one row)
Does anyone know a good way I can go about doing this? There was a similar question here before but it was a bit different and I can't really apply it to my data frame (especially since I have to sum the Volume based on several columns). Thanks in advance.