I am trying to make a new data frame that contains the mean of a binary variable. For instance, I have:
Win | Average |
---|---|
1 | 1 |
1 | 1 |
0 | 0.66 |
0 | 0.5 |
0 | 0.4 |
1 | 0.5 |
0 | .42 |
On the "Win" category, I have some 500 entries. I am looking to build a new column like "Average" that calculates the average of the entry in the "Win" column up to that point -- not the average of the "Win" category completely. So an entry in row number 56 will calculate the average Win Rate from column 1 to 56 and populate it in the corresponding row.