Transforming a dataframe of probabilities for specific periods to be probabilities of at least once over n periods?
问题 I've got a dataframe which has probabilities for different events over a large number of sequential periods, and I want to transform this df to show the probability of something happening at least once over n periods. eg, I've got this, which would be n = 1: event | period | probability A | period 1 | 0.6 A | period 2 | 0.7 A | period 3 | 0.8 A | period 4 | 0.85 A | period 5 | 0.9 And I want to figure out the probability of A occurring at least once across two periods (n = 2), which would be: