title: how to fix this error 'numpy.ndarray' object has no attribute 'append' in the code below
body: <p>Returns this error:
  'numpy.ndarray' object has no attribute 'append'</p>
  
  <pre><code>class1 = np.array([]) #creates 2 empty arrays
  class2 = np.array([])
  
  #yhat_tr is a vector(1 column, 100 rows) = numpy.ndarray
  for i in yhat_tr: 
    if i &lt; 0:
      class1.append([i]) #insert the iten in the array class1 or class2
    else:
      class2.append([i])
  </code></pre>
  
  <p>I want to insert new array itens inside the class1 or class2 arrays as soon the itens are evaluated inside the loop.
  After that i will try to print the results in a scatter graphic with 2 colors where i can identify visually the class1 and class2 elements.</p>