Custom column on dataframe based on other columns

Viewed 30

I have a dataframe as seen below:

df =  | class |
          0
          1
          1
         ...
          0

where number of rows is 113269 where number of ones = 46337 and number of zeros = 66932. What i would like to do is create a feature named id with random numbers for 0 to 50.
As a result each id will have some 0s and some 1s assigned to it.
Through tests i noticed that each id has a similar distribution of 1s and 0s compared to the distribution of the original whole dataset (which is zeros/ones = 1.444 ). What i want is to be able to change manualy this number for as many clients as possible.
Any ideas?

0 Answers
Related