title: Remove elements from numpy array?
body: <p>i have a numpy array as </p>
  
  <pre><code>text = [[...],[...],[...],[...]]
  </code></pre>
  
  <p>number of elements in text is 4 X 80.</p>
  
  <pre><code>Values = [[...],[...],[...],[...]]
  </code></pre>
  
  <p>Number of elements in values is 4 X 80</p>
  
  <p>Now What I want to do is remove all the spaces at the last after the string characters ends in the <code>text</code> text[3] block and I want to remove the corresponding index in values as well, </p>
  
  <p>How to attain this in fastest way?</p>
  
  <p>I want it to generalised so when elements increase , it should work.</p>
  
  <p>Updating code while learning from net</p>
  
  <p>** Now how to delete those 30 elements from last**</p>
  
  <pre><code>import numpy as np
  
  a = np.array([[...],[...],[...],[...]])
  count = 0
  for elem in reversed(a[len(a)-1]):
      if elem == ' ':
          count = count + 1
          #new = np.delete(a[len(a)-1], np.where(elem == ' '), axis=0)
      if elem != ' ':
          break
  </code></pre>