I have a table in which one of the columns is the date of occurrence (the data frame is not indexed by date)
I want to group a table by date, in which all the elements that occurred before a certain date are grouped in one bucket. This should be cumulative, so later buckets will include all data points from earlier ones.
Here's the daterange object that I need to group:
date_rng = date_range('28/02/2010','31/08/2014',freq='3M')
Here is an example of several data points in a table:
df_raw.head() Ticker FY Periodicity Measure Val Date 0 BP9DL90 2009 ANN CPX 1000.00 2008-03-31 00:00:00 1 BP9DL90 2010 ANN CPX 600.00 2009-03-25 00:00:00 2 BP9DL90 2010 ANN CPX 600.00 2009-09-16 00:00:00 3 BP9DL90 2011 ANN CPX 570.00 2010-03-17 00:00:00 4 BP9DL90 2011 ANN GRM 57.09 2010-09-06 00:00:00 [5 rows x 6 columns]
Any input is appreciated.
thanks
source share