I have one column in pandas data frame with hex values, for example:
Data
1A
2B
BB
FF
A7
78
CB
I want to convert hex values in binary, then from binary to take first 3 bits and finally convert 3 bits value in decimal.
Data column in binary will be:
Data
00011010
00101011
10111011
11111111
10100111
01111000
11001011
the first 3 bits:
Data
010
011
011
111
111
000
011
and finally the desired value in decimal:
Data
2
3
3
7
7
0
3
How to do this? I tried with bin() function, but it doesn't work with pandas data frames.