title: pandas - accessing rows of a SparseDataFrame
body: <p>I have a large SparseDataFrame (say, 20k indices x 10k columns) with a very low density (0.1% of the entries are set.) I'm trying to access to a specific <strong>row</strong> of the data frame, but I can't seem to be able to do so. Accessing columns is fine though. Here's a small example that illustrates the problem:</p>
  
  <pre><code>import numpy as np
  import pandas as pd
  
  df = pd.DataFrame(np.arange(15).reshape(5,3), index=list('abcde'))
  df.loc['b',1] = np.nan  # for good measure...
  sparse = df.to_sparse()
  
  sparse[1]  # This is OK.
  df.loc['b']  # This is also OK.
  sparse.loc['b'] # This blows up.
  </code></pre>
  
  <p>Here's the traceback:</p>
  
  <pre><code>Traceback (most recent call last):
    File "&lt;stdin&gt;", line 1, in &lt;module&gt;
    File "/Users/.../.virtualenvs/exp/lib/python2.7/site-packages/pandas/core/indexing.py", line 1020, in __getitem__
      return self._getitem_axis(key, axis=0)
    File "/Users/.../.virtualenvs/exp/lib/python2.7/site-packages/pandas/core/indexing.py", line 1145, in _getitem_axis
      return self._get_label(key, axis=axis)
    File "/Users/.../.virtualenvs/exp/lib/python2.7/site-packages/pandas/core/indexing.py", line 68, in _get_label
      return self.obj._xs(label, axis=axis, copy=True)
    File "/Users/.../.virtualenvs/exp/lib/python2.7/site-packages/pandas/core/frame.py", line 2149, in xs
      new_values, copy = self._data.fast_2d_xs(loc, copy=copy)
    File "/Users/.../.virtualenvs/exp/lib/python2.7/site-packages/pandas/core/internals.py", line 2714, in fast_2d_xs
      result[i] = blk._try_coerce_result(blk.iget((j, loc)))
    File "/Users/.../.virtualenvs/exp/lib/python2.7/site-packages/pandas/core/internals.py", line 275, in iget
      return self.values[i]
    File "/Users/.../.virtualenvs/exp/lib/python2.7/site-packages/pandas/sparse/array.py", line 286, in __getitem__
      data_slice = self.values[key]
  IndexError: too many indices
  </code></pre>
  
  <p>Note that on "normal", dense DataFrame objects it works well. However, due to the large dimensions I have it is a major inconvenience for me to either:</p>
  
  <ol>
  <li>transpose the data frame (takes ages)</li>
  <li>convert to a dense data frame (eats up way too much memory)</li>
  </ol>
  
  <p>I'm relatively new to pandas, so maybe I'm missing something. In any case, any help is appreciated!</p>