title: python-AttributeError: 'NoneType' object has no attribute 'remove'
body: <p>I have a 3D list in python like:</p>
  
  <pre><code>features= [ [[1,2,3],[1,2,3],[1,2,3]] ,None , [[1,2,3],[1,2,3],[1,2,3]],
          [[1,2,3],[1,2,3],[1,2,3]], None,None,[[1,2,3],[1,2,3],[1,2,3]] ]
  </code></pre>
  
  <p>I expect to see:</p>
  
  <pre><code>features=[ [[1,2,3],[1,2,3],[1,2,3]] ,[[1,2,3],[1,2,3],[1,2,3]],
                 [[1,2,3],[1,2,3],[1,2,3]] ,[[1,2,3],[1,2,3],[1,2,3]] ]
  </code></pre>
  
  <p>When I try to remove <code>None</code> using the following code:</p>
  
  <pre><code>for i in range(len(features)):
  if features[i]==None:
      features[i].remove()
  </code></pre>
  
  <p>It produces the error :</p>
  
  <blockquote>
    <p>AttributeError: 'NoneType' object has no attribute 'remove'</p>
  </blockquote>
  
  <p>If I try this: </p>
  
  <pre><code>for i in range(len(features)):
  if features[i]==None:
      del features[i]
  </code></pre>
  
  <p>It produces error:</p>
  
  <blockquote>
    <p>ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()</p>
  </blockquote>
  
  <p>Lastly I tried this code:</p>
  
  <pre><code>for i in range(len(features)):
  if features[i]==None:
      features[i]=filter(None,features[i])
  </code></pre>
  
  <p>It produced the error :-</p>
  
  <blockquote>
    <p>TypeError: 'NoneType' object is not iterable</p>
  </blockquote>
  
  <p>How can I fix this error?</p>