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