I'd like to make a while / for loop in python to save dataframes into csv files.
The files should be named something like: Day1, Day2, Day3...Day90
First i determine for the n-th day, how large of a sample I should draw, based on a forecast.
Then the sample is drawn from the population (Orders_df), and should be written into a csv file
Period = list(range(0,90))
Period
for item in Period:
Percentage = (forecast['yhat'].iloc[Period]) / (forecast['yhat'].max())
Samplesize = round( Orders_df.lat.count() / 90 * Percentage)
Orders_df.sample(Samplesize).to_csv('Day'&Period&'.csv', index=False)