dimanche 2 mai 2021

Pandas Different Sampling Size

Anyone can help me with pandas?

I have a set of data n= 50, how can I select random sample from the data if i required to randomly selected it based on different size.

For example:

  1. a = From 50, i need to select 25
  2. b = From 50, i need to select 5
  3. c = Fom 50, i need to select 10
  4. d = From 50, i need to select 2
  5. e = From 50, i need to select 8

I used

a = df.sample(25)

how can i make sure, if i create b=df.sample(5) it is not a same sample with a,c,d,e?




Aucun commentaire:

Enregistrer un commentaire