title: Python - read text file with weird utf-16 format
body: <p>I'm trying to read a text file into python, but it seems to use some very strange encoding. I try the usual: </p>
  
  <pre><code>file = open('data.txt','r')
  
  lines = file.readlines()
  
  for line in lines[0:1]:
      print line,
      print line.split()
  </code></pre>
  
  <p>Output: </p>
  
  <pre><code>0.0200197   1.97691e-005
  
  ['0\x00.\x000\x002\x000\x000\x001\x009\x007\x00', '\x001\x00.\x009\x007\x006\x009\x001\x00e\x00-\x000\x000\x005\x00']
  </code></pre>
  
  <p>Printing the line works fine, but after I try to split the line so that I can convert it into a float, it looks crazy. Of course, when I try to convert those strings to floats, this produces an error. Any idea about how I can convert these back into numbers? </p>
  
  <p>I put the sample datafile here if you would like to try to load it: 
  <a href="https://dl.dropboxusercontent.com/u/3816350/Posts/data.txt" rel="noreferrer">https://dl.dropboxusercontent.com/u/3816350/Posts/data.txt</a></p>
  
  <p>I would like to simply use numpy.loadtxt or numpy.genfromtxt, but they also do not want to deal with this crazy file.</p>