title: Modify matrix based on column values
body: <p>I have a matrix </p>
  
  <pre><code>a = [[1,2,-3,1],
       [-1,0,0,1], 
       [1,1,1,1]]
  </code></pre>
  
  <p>i want to modify it such that the result will contain only the columns that are positive.</p>
  
  <pre><code>a =  [[2, 1], 
        [0, 1], 
        [1, 1]]
  
  def removing_missing_data(x):
  
      """
      input: lists of lists.
      return: non-negative values.
      """
      for i in x:
          f = []
          for k in i:
              if k &lt; 0:
                  f.append(i.index(k))
          t(f,x)
  
  def t(x,y):
      count = 0
      for i in x:
          i = i - count
          for l in y:
              l.pop(i)
          count+=1
  </code></pre>
  
  <p>The code above works but its not efficient way to deal when the matrix is too large. I would like to know if there is any way to deal with this issue to optimize the running time so it can be used on large data sets.</p>