I have this data frame. I would like to create another data frame from this which will include Trade_Date, Trades and Rejected. The rejected field needs to have the values from Closing_Date which will have to meet this criteria – Trade_Date + 1 day.
x
Trade_Date Trades Closing_Date Rejected
9/16/2011 4126528 9/16/2011 15
9/19/2011 2565282 9/17/2011 33
9/20/2011 2953963 9/20/2011 30
9/21/2011 3255800 9/21/2011 6
9/22/2011 2862185 9/22/2011 21
9/23/2011 2405590 9/23/2011 30
9/26/2011 3196284 9/24/2011 30
9/27/2011 3761367 9/27/2011 15
9/28/2011 3198177 9/28/2011 9
9/29/2011 3255345 9/29/2011 6
9/30/2011 3810356 9/30/2011 12
10/3/2011 3817093 10/1/2011 21
for example, my next df will need to be like this:
Trade_Date Trades Rejected
9/16/2011 4126528 33
9/19/2011 2565282 30
9/20/2011 2953963 6
etc
Since there are many many rows, I need to do this programatically. Can any help?
None of the rows in your example data frame meet the criteria you specify, so I will alter it slightly to demonstrate a simple way of doing this: