title: How can I iterate through a python 2D list and delete/replace characters from a specific column?
body: <p>I have the following 2D list</p>
  
  <pre><code>data = [['2013-02-03', 'London', 'miles', '25'], ['2013-02-03', 'Newcastle', 'miles', '25'], ['2013-02-03', 'Birmingham', 'miles', '62']]
  </code></pre>
  
  <p>I need to be able to remove any of the <code>''</code> in a column 
  e.g last column below so i can pass the 2D list to a javascript function in a text file.</p>
  
  <pre><code>data = [['2013-02-03', 'London', 'miles', 25], ['2013-02-03', 'Newcastle', 'miles', 25], ['2013-02-03', 'Birmingham', 'miles', 62]]
  </code></pre>
  
  <p>I have a function and can get the result on a single value</p>
  
  <pre><code>r = "['2013-02-03', 'London', 'miles', '25']"
  
  
  def rreplace(s, old, new, occurrence):
      li = s.rsplit(old, occurrence)
      return new.join(li)
  
      rreplace(p, "'", '', 2)
  
  "['2013-02-03', 'Feltham', 'less_than_one_day', 25],"
  </code></pre>
  
  <p>Can anyone suggest a better way to achieve this result?</p>
  
  <p>I have tried a number of ways using: for loops, map/lambda and 
  iter, I can loop through the list or change an element in single list
  just can't do both and output the result.</p>