lundi 18 juillet 2022

sampling from a DataFrame on a daily basis

in my data frame, I have data for 3 months, and it's per day. ( for every day, I have a different number of samples, for example on 1st January I have 20K rows of samples and on the second of January there are 15K samples)

what I need is that I want to take the mean number and apply it to all the data frames. for example, if the mean value is 8K, i want to get the random 8k rows from 1st January data and 8k rows randomly from 2nd January, and so on.

as far as I know, rand() will give the random values of the whole data frame, But I need to apply it per day. since my data frame is on a daily basis and the date is mentioned in a column of the data frame. Thanks




Aucun commentaire:

Enregistrer un commentaire