title: Convert binary to signed, little endian 16bit integer in Python
body: <p>Trying to a convert a binary list into a signed 16bit little endian integer</p>
  <pre><code>input_data = [['1100110111111011','1101111011111111','0010101000000011'],['1100111111111011','1101100111111111','0010110100000011']]
  Desired Output =[[-1074, -34, 810],[-1703, -39, 813]]
  </code></pre>
  <p>This is what I've got so far. It's been adapted from: <a href="https://stackoverflow.com/questions/6727875/hex-string-to-signed-int-in-python-3-2">Hex string to signed int in Python 3.2?</a>,
  <a href="https://stackoverflow.com/questions/24563786/conversion-from-hex-to-signed-dec-in-python">Conversion from HEX to SIGNED DEC in python</a></p>
  <pre><code>results = []
  for i in input_data:
     hex_convert = [hex(int(x,2)) for x in i]
     convert = [int(y[4:6] + y[2:4], 16) for y in hex_convert]
     results.append(convert)
  print (results)
  output: [[64461, 65502, 810], [64463, 65497, 813]]
  </code></pre>
  <p>This is works fine, but the above are unsigned integers. I need signed integers capable of handling negative values. I then tried a different approach:</p>
  <pre><code>results_2 = []
  for i in input_data:
     hex_convert = [hex(int(x,2)) for x in i]
     to_bytes = [bytes(j, 'utf-8') for j in hex_convert]
     split_bits = [int(k, 16) for k in to_bytes]
     convert_2 = [int.from_bytes(b, byteorder = 'little', signed = True) for b in to_bytes]
     results_2.append(convert_2)
  print (results_2)
  Output: [[108191910426672, 112589973780528, 56282882144304], [108191943981104, 112589235583024, 56282932475952]]
  </code></pre>
  <p>This result is even more wild than the first. I know my approach is wrong, and it doesn't help that i've never been able to get my head around binary conversion etc, but I feel i'm on the right path with:</p>
  <pre><code>(b, byteorder = 'little', signed = True)
  </code></pre>
  <p>but can't work out where i'm wrong. Any help explaining this concept would be greatly appreciated.</p>