Skip to content
Prev 377698 / 398502 Next

sample (randomly select) to get a number of successive days

Hi Marc,

Yes, you got it to the point! That is exactly what I want. But I do not know how to do that. I know how to randomly pick the first day but I do not know how to set a range of values which cover the 25 days starting from that random value.

Best,
Dagmar


Hi,

I am confused.

As far as I can tell, only the first day is selected randomly from your dataset. The subsequent 24 days are deterministic, since they need to be consecutive days from the first day, for a total of 25 consecutive days.

Thus, all you need to do is to randomly select 1 day from within the time range of your dataset to be the first day, that is also far enough from the maximum date, to allow you to then select the data from the additional 24 consecutive days.

So randomly pick your first day and set a range of values, covering the 25 days, to use to then subset your full dataset.

What am I missing?

Regards,

Marc Schwartz