title: Error "TypeError: type numpy.ndarray doesn't define __round__ method"
body: <pre><code>import numpy
  
  ......
  
  # Prediction
  predictions = model.predict(X_test)
  # round predictions
  rounded = [round(x) for x in predictions]
  print(rounded)
  
  "predictions" is a list of decimals between [0,1] with sigmoid output. 
  </code></pre>
  
  <p>Why does it always report this error:</p>
  
  <pre><code>  File "/home/abigail/workspace/ml/src/network.py", line 41, in &lt;listcomp&gt;
      rounded = [round(x) for x in predictions]
  TypeError: type numpy.ndarray doesn't define __round__ method
  </code></pre>
  
  <p>If i don't use the 'round', it prints decimals correctly. This "round" should be the Python built-in function. Why does it have anything to do with numpy?</p>
  
  <p>Edited:</p>
  
  <pre><code>for x in predictions:
      print(x, end=' ')
  </code></pre>
  
  <p>The output is:</p>
  
  <pre><code>    [ 0.79361773] [ 0.10443521] [ 0.90862566] [ 0.10312044] [ 0.80714297] 
  [ 0.23282401] [ 0.1730803] [ 0.55674052] [ 0.94095331] [ 0.11699325] 
  [ 0.1609294] 
  </code></pre>