Saving prediction results to CSV : <p>I am storing the results from a sklearn regression model to the varibla prediction.</p>

<pre><code>prediction = regressor.predict(data[['X']])
print(prediction)
</code></pre>

<p>The values of the prediction output looks like this</p>

<pre><code>[ 266.77832991  201.06347505  446.00066136  499.76736079  295.15519906
  214.50514991  422.1043505   531.13126879  287.68760191  201.06347505
  402.68859792  478.85808879  286.19408248  192.10235848]
</code></pre>

<p>I am then trying to use the to_csv function to save the results to a local CSV file:</p>

<pre><code>prediction.to_csv('C:/localpath/test.csv')
</code></pre>

<p>But the error I get back is:</p>

<pre><code>AttributeError: 'numpy.ndarray' object has no attribute 'to_csv'
</code></pre>

<p>I am using Pandas/Numpy/SKlearn.  Any idea on the basic fix?</p>
