This question is a variation of this one, the only difference being that the dates can repeat in the rows of a DataFrame. So, the example would be:
| Date | Position | TrainerID | Win% |
|---|---|---|---|
| 2017-09-03 | 4 | 1788 | 0 (0 wins, 1 race) |
| 2017-09-16 | 5 | 1788 | 0 (0 wins, 2 races) |
| 2017-10-14 | 1 | 1788 | 33 (1 win, 3 races) |
| 2017-10-14 | 3 | 1788 | 25 (1 win, 4 races) |
Is it possible to compute Win% in these conditions for the last 1000 days? If so, how?