<p dir="auto">I didn't see this error reported, apologies if it is a duplicate -- my current numpy is 1.6.2.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$ sudo easy_install --upgrade numpy
Searching for numpy
Reading http://pypi.python.org/simple/numpy/
Reading http://numpy.scipy.org
Reading http://sourceforge.net/project/showfiles.php?group_id=1369&amp;package_id=175103
Reading http://www.numpy.org
Reading http://sourceforge.net/projects/numpy/files/NumPy/
Reading http://numeric.scipy.org
Best match: numpy 1.7.0
Downloading http://pypi.python.org/packages/source/n/numpy/numpy-1.7.0.zip#md5=ca27913c59393940e880fab420f985b4
Processing numpy-1.7.0.zip
Running numpy-1.7.0/setup.py -q bdist_egg --dist-dir /tmp/easy_install-vw2DNu/numpy-1.7.0/egg-dist-tmp-gJGWkL
Running from numpy source directory.
error: SandboxViolation: open('/dev/null', 'w') {}

The package setup script has attempted to modify files on your system
that are not within the EasyInstall build area, and has been aborted.

This package cannot be safely installed by EasyInstall, and may not
support alternate installation locations even if you run its setup
script by hand.  Please inform the package's author and the EasyInstall
maintainers to find out if a fix or workaround is available."><pre class="notranslate"><code class="notranslate">$ sudo easy_install --upgrade numpy
Searching for numpy
Reading http://pypi.python.org/simple/numpy/
Reading http://numpy.scipy.org
Reading http://sourceforge.net/project/showfiles.php?group_id=1369&amp;package_id=175103
Reading http://www.numpy.org
Reading http://sourceforge.net/projects/numpy/files/NumPy/
Reading http://numeric.scipy.org
Best match: numpy 1.7.0
Downloading http://pypi.python.org/packages/source/n/numpy/numpy-1.7.0.zip#md5=ca27913c59393940e880fab420f985b4
Processing numpy-1.7.0.zip
Running numpy-1.7.0/setup.py -q bdist_egg --dist-dir /tmp/easy_install-vw2DNu/numpy-1.7.0/egg-dist-tmp-gJGWkL
Running from numpy source directory.
error: SandboxViolation: open('/dev/null', 'w') {}

The package setup script has attempted to modify files on your system
that are not within the EasyInstall build area, and has been aborted.

This package cannot be safely installed by EasyInstall, and may not
support alternate installation locations even if you run its setup
script by hand.  Please inform the package's author and the EasyInstall
maintainers to find out if a fix or workaround is available.
</code></pre></div>
<p dir="auto">Sorry in advance if this is a duplicate. I'm trying to read the <a href="https://www.kaggle.com//uciml/iris" rel="nofollow">Iris dataset</a> using the following code:<br>
<code class="notranslate">data = numpy.genfromtxt('../input/Iris.csv',delimiter=',',usecols= range(1,6),skip_header=1, dtype = None)</code>.<br>
However, when I try to separate the features and labels using this -<br>
<code class="notranslate">features = data[:,:-1]</code><br>
<code class="notranslate">labels = data[:,-1:]</code><br>
the following error occurs :</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="---------------------------------------------------------------------------
IndexError                                Traceback (most recent call last)
&lt;ipython-input-48-a596c22da600&gt; in &lt;module&gt;()
----&gt; 1 features = data[:,:-1]
      2 features.shape

IndexError: too many indices for array
"><pre class="notranslate"><code class="notranslate">---------------------------------------------------------------------------
IndexError                                Traceback (most recent call last)
&lt;ipython-input-48-a596c22da600&gt; in &lt;module&gt;()
----&gt; 1 features = data[:,:-1]
      2 features.shape

IndexError: too many indices for array

</code></pre></div>
<p dir="auto">This error also persists when I use the following :</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="data = np.genfromtxt('../input/Iris.csv',delimiter=',',usecols= range(1,6),skip_header=1,dtype={'names': ('sepal length', 'sepal width', 'petal length', 'petal width', 'label'),
          'formats': (np.float, np.float, np.float, np.float, '|S15')})"><pre class="notranslate"><code class="notranslate">data = np.genfromtxt('../input/Iris.csv',delimiter=',',usecols= range(1,6),skip_header=1,dtype={'names': ('sepal length', 'sepal width', 'petal length', 'petal width', 'label'),
          'formats': (np.float, np.float, np.float, np.float, '|S15')})
</code></pre></div>
<p dir="auto">However, this kind of indexing works fine when I do not pass <code class="notranslate">dtype</code> as argument at all, but the only problem with that is the labels are read as <code class="notranslate">NaN</code> , which cannot be processed further to numerically encode separately.</p>