Numpy is adding dot(.) from CSV data
<p>I am reading CSV as:</p>

<pre><code>import numpy as np
features = np.genfromtxt('train.csv',delimiter=',',usecols=(1,2))
</code></pre>

<p>It outputs data as:</p>

<blockquote>
  <p>[[-1. -1.]  [ 1. -1.]  [-1.  1.]  [ 1. -1.]]. See the dot after <code>1</code> and <code>-1</code></p>
</blockquote>

<p><strong>train.csv</strong></p>

<pre><code>0,-1,-1
-1,1,-1
0,-1,1
1,1,-1
-1,1,-1
0,1,-1
</code></pre>

<p>As stated in the comments : <code>np.genfromtxt</code> is simply converting your data to float numbers by default (<a href="http://docs.scipy.org/doc/numpy/reference/generated/numpy.genfromtxt.html" rel="nofollow">see the default dtype argument in the function signature</a>). If you want to force the output to integers just specify <code>dtype=np.int</code> in genfromtxt:</p>

<pre><code>features = np.genfromtxt('train.csv',delimiter=',',usecols=(1,2),dtype=np.int)
</code></pre>

python numpy