I am working with a large data frame, which has 'sex' as one of the columns. It lookssomething like this
OriginalDF
SEX X1 X2 X3 X4
0 15 91 12 25
1 12 92 32 35
1 14 94 12 45
0 12 91 42 15
0 11 95 12 25
I would like to be able to transform it into two separate dataframes, based on the binary sex variable;
DF1
SEX X1 X2 X3 X4
0 15 91 12 25
0 12 91 42 15
0 11 95 12 25
DF2
SEX X1 X2 X3 X4
1 12 92 32 35
1 14 94 12 45
How can I accomplish this efficiently?
Thanks in advance!