I’m dealing with a large data set and I have a column that is treat as an object
Genotype | Iteration |
---|---|
10010110011011101101011000010011111011111000000111001001101111111101101111001011 | 0 |
00011100001011010000000110010010100101101011001010101110110111000101000110000000 | 0 |
00100100100100101000100101100110100101110000100111000000011001011001101111000011 | 0 |
10001010101100000101110001011111000110101100101010111100110011011101010011111110 | 0 |
11010101010010001110100110110001001010101001111000111011110110101101010100011110 | 0 |
This column is Genotype
. Pandas right now is treating this column as an object and I don’t know if there is any data type that allows me to treat it as a binary number (I guess that it’s going to be cheaper??).
What interest me of this colum is the number of 1
‘s that appear in each row so something like this I don’t think that is going to work
df["Genotype"] = [int(x,2) for x in df["Genotype"]]