title: Converting a numpy array to integer with astype(int) does not work on Python 3.6
body: <p>I have a large text file with labels 0 or 1 in each line like this:</p>
  
  <pre><code>1
  0
  0
  1
  ...
  </code></pre>
  
  <p>I load it, convert it into a numpy array, and then I want to convert the array into <code>dtype=int64</code> (as I assume these are strings). I do it like this:</p>
  
  <pre><code>def load_data(infile):
      text_file = open(infile,'r')
      text = text_file.readlines()
      text = map(str.strip,text)
      return text
  labels = load_data('labels.txt')
  labels_encoded = np.array(labels)
  labels_encoded = labels_encoded.astype(int)
  </code></pre>
  
  <p>It works fine in Python 2.7, and I can work on the array later with my code, but for now I'm stuck with Python 3.6 and when I ran my code, I get an error:</p>
  
  <pre><code>Traceback (most recent call last):
     File "dText.py", line 77, in &lt;module&gt;
     labels_encoded = labels_encoded.astype(int)
  TypeError: int() argument must be a string, a bytes-like object or a number, not 'map'
  </code></pre>
  
  <p>Can anyone help me figure out what is going on here and how to get it to work on Python 3.6? I also tried:</p>
  
  <pre><code>labels_encoded = np.int_(labels_encoded)
  </code></pre>
  
  <p>but I got the same error. I'm using numpy version 1.13.3. Thanks.</p>