mercredi 26 juin 2019

How to select n chunks randomly from a dataset

I have 100 chunks of samples at which each chunk has 100 elements. The elements in one chunk are 5 seconds apart; However the time difference between the elements from different chunks is 5 hours at least (not fixed time). My main goal is to pick 10 chunks from the dataset Randomly .

My dataset:

index     time                  value   
i       12-1-2019 05:22:43       12         }  Chunk 1
i+1     12-1-2019 05:22:48       13
i+2     12-1-2019 05:22:53       14
..
i+99  ...............................

i+x      12-1-2019 13:32:12      31         }  Chunk 2
i+x+1    12-1-2019 13:32:17      77
i+x+2    12-1-2019 13:32:22      16
..
i+x+99  ...............................

i+x      14-1-2019 23:45:43      14         }  Chunk 3
i+x+1    14-1-2019 23:45:48      57
i+x+2    14-1-2019 23:45:53      46
..
i+x+99  ...............................

Note: the chunks are ordered (i.e: Chunk 1 occurred before chunk 2 that occurred before chunk 3 and so on).

I would like to pick 10 chunk of 100 randomly. However, the order of the elements in the chunk is important and can't be shuffled.




Aucun commentaire:

Enregistrer un commentaire