title: ValueError: invalid literal for int() with base 10: '-' (Python)
body: <p>I was trying to convert an array into an integer, and it should've been easy. But I've come up with this error:</p>
  
  <pre><code>Traceback (most recent call last):
  File "C:\Users\Joao\Desktop\Box Count (ongoing).py", line 32, in &lt;module&gt;
  pixels = [map(int, x) for x in array]
  ValueError: invalid literal for int() with base 10: '-'
  </code></pre>
  
  <p>The problem is that i'm reading a file that's an ascii grid, that for a no_data value assigns a -9999 number ( it does so because in editing it's easier to target). So pretty much I could use a regex to change this values to another ones but I don't want to, so I'm wondering if it's just a gap in my code or if I'm not thinking this through. Can someone point out a solution?</p>
  
  <p>Code:</p>
  
  <pre><code>im = open('input.txt', 'r')
  
  imgx = 1452
  imgy = 1916
  
  array = []
  with open("qqqf.txt", "r") as im:
      for line in im:
          array.append(line)
  
  print array
  
  pixels = [map(int, x) for x in array]
  </code></pre>
  
  <p>input file:</p>
  
  <pre><code>-9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 1 1 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 
  </code></pre>