<p dir="auto">I am using Pandas 0.13.0rc1-23-g286811a, Python 2.7 and Windows XP.</p>
<p dir="auto">The space in column names is apparently causing a problem. On IPython,</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="df = pd.DataFrame(columns=['a', 'b', 'c c'])
df['d'] = 3
df['c c']"><pre class="notranslate"><code class="notranslate">df = pd.DataFrame(columns=['a', 'b', 'c c'])
df['d'] = 3
df['c c']
</code></pre></div>
<p dir="auto">Error</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="C:\python_envs\prod2\lib\site-packages\pandas\core\frame.pyc in __getitem__(self, key)
   1626             return self._getitem_multilevel(key)
   1627         else:
-&gt; 1628             return self._getitem_column(key)
   1629
   1630     def _getitem_column(self, key):

C:\python_envs\prod2\lib\site-packages\pandas\core\frame.pyc in _getitem_column(self, key)
   1633         # get column
   1634         if self.columns.is_unique:
-&gt; 1635             return self._get_item_cache(key)
   1636
   1637         # duplicate columns &amp; possible reduce dimensionaility

C:\python_envs\prod2\lib\site-packages\pandas\core\generic.pyc in _get_item_cache(self, item)
    977         if res is None:
    978             values = self._data.get(item)
--&gt; 979             res = self._box_item_values(item, values)
    980             cache[item] = res
    981             res._cacher = (item, weakref.ref(self))

C:\python_envs\prod2\lib\site-packages\pandas\core\frame.pyc in _box_item_values(self, key, values)
   1834             return self._constructor(values.T, columns=items, index=self.index)
   1835         else:
-&gt; 1836             return self._box_col_values(values, items)
   1837
   1838     def _box_col_values(self, values, items):

C:\python_envs\prod2\lib\site-packages\pandas\core\frame.pyc in _box_col_values(self, values, items)
   1839         &quot;&quot;&quot; provide boxed values for a column &quot;&quot;&quot;
   1840         return self._constructor_sliced.from_array(values, index=self.index,
-&gt; 1841                                                    name=items, fastpath=True)
   1842
   1843     def __setitem__(self, key, value):

C:\python_envs\prod2\lib\site-packages\pandas\core\series.pyc in from_array(cls, arr, index, name, copy, fastpath)
    233             cls = SparseSeries
    234
--&gt; 235         return cls(arr, index=index, name=name, copy=copy, fastpath=fastpath)
    236
    237     @property

C:\python_envs\prod2\lib\site-packages\pandas\core\series.pyc in __init__(self, data, index, dtype, name, copy, fastpath
)
    130             # data is an ndarray, index is defined
    131             if not isinstance(data, SingleBlockManager):
--&gt; 132                 data = SingleBlockManager(data, index, fastpath=True)
    133             if copy:
    134                 data = data.copy()

C:\python_envs\prod2\lib\site-packages\pandas\core\internals.pyc in __init__(self, block, axis, do_integrity_check, fast
path)
   3413                 block = block[0]
   3414             if not isinstance(block, Block):
-&gt; 3415                 block = make_block(block, axis, axis, ndim=1, fastpath=True)
   3416
   3417         else:

C:\python_envs\prod2\lib\site-packages\pandas\core\internals.pyc in make_block(values, items, ref_items, klass, ndim, dt
ype, fastpath, placement)
   1893
   1894     return klass(values, items, ref_items, ndim=ndim, fastpath=fastpath,
-&gt; 1895                  placement=placement)
   1896
   1897

C:\python_envs\prod2\lib\site-packages\pandas\core\internals.pyc in __init__(self, values, items, ref_items, ndim, fastp
ath, placement)
   1297         super(ObjectBlock, self).__init__(values, items, ref_items, ndim=ndim,
   1298                                           fastpath=fastpath,
-&gt; 1299                                           placement=placement)
   1300
   1301     @property

C:\python_envs\prod2\lib\site-packages\pandas\core\internals.pyc in __init__(self, values, items, ref_items, ndim, fastp
ath, placement)
     63         if len(items) != len(values):
     64             raise ValueError('Wrong number of items passed %d, indices imply '
---&gt; 65                              '%d' % (len(items), len(values)))
     66
     67         self.set_ref_locs(placement)

ValueError: Wrong number of items passed 1, indices imply 0"><pre class="notranslate"><code class="notranslate">C:\python_envs\prod2\lib\site-packages\pandas\core\frame.pyc in __getitem__(self, key)
   1626             return self._getitem_multilevel(key)
   1627         else:
-&gt; 1628             return self._getitem_column(key)
   1629
   1630     def _getitem_column(self, key):

C:\python_envs\prod2\lib\site-packages\pandas\core\frame.pyc in _getitem_column(self, key)
   1633         # get column
   1634         if self.columns.is_unique:
-&gt; 1635             return self._get_item_cache(key)
   1636
   1637         # duplicate columns &amp; possible reduce dimensionaility

C:\python_envs\prod2\lib\site-packages\pandas\core\generic.pyc in _get_item_cache(self, item)
    977         if res is None:
    978             values = self._data.get(item)
--&gt; 979             res = self._box_item_values(item, values)
    980             cache[item] = res
    981             res._cacher = (item, weakref.ref(self))

C:\python_envs\prod2\lib\site-packages\pandas\core\frame.pyc in _box_item_values(self, key, values)
   1834             return self._constructor(values.T, columns=items, index=self.index)
   1835         else:
-&gt; 1836             return self._box_col_values(values, items)
   1837
   1838     def _box_col_values(self, values, items):

C:\python_envs\prod2\lib\site-packages\pandas\core\frame.pyc in _box_col_values(self, values, items)
   1839         """ provide boxed values for a column """
   1840         return self._constructor_sliced.from_array(values, index=self.index,
-&gt; 1841                                                    name=items, fastpath=True)
   1842
   1843     def __setitem__(self, key, value):

C:\python_envs\prod2\lib\site-packages\pandas\core\series.pyc in from_array(cls, arr, index, name, copy, fastpath)
    233             cls = SparseSeries
    234
--&gt; 235         return cls(arr, index=index, name=name, copy=copy, fastpath=fastpath)
    236
    237     @property

C:\python_envs\prod2\lib\site-packages\pandas\core\series.pyc in __init__(self, data, index, dtype, name, copy, fastpath
)
    130             # data is an ndarray, index is defined
    131             if not isinstance(data, SingleBlockManager):
--&gt; 132                 data = SingleBlockManager(data, index, fastpath=True)
    133             if copy:
    134                 data = data.copy()

C:\python_envs\prod2\lib\site-packages\pandas\core\internals.pyc in __init__(self, block, axis, do_integrity_check, fast
path)
   3413                 block = block[0]
   3414             if not isinstance(block, Block):
-&gt; 3415                 block = make_block(block, axis, axis, ndim=1, fastpath=True)
   3416
   3417         else:

C:\python_envs\prod2\lib\site-packages\pandas\core\internals.pyc in make_block(values, items, ref_items, klass, ndim, dt
ype, fastpath, placement)
   1893
   1894     return klass(values, items, ref_items, ndim=ndim, fastpath=fastpath,
-&gt; 1895                  placement=placement)
   1896
   1897

C:\python_envs\prod2\lib\site-packages\pandas\core\internals.pyc in __init__(self, values, items, ref_items, ndim, fastp
ath, placement)
   1297         super(ObjectBlock, self).__init__(values, items, ref_items, ndim=ndim,
   1298                                           fastpath=fastpath,
-&gt; 1299                                           placement=placement)
   1300
   1301     @property

C:\python_envs\prod2\lib\site-packages\pandas\core\internals.pyc in __init__(self, values, items, ref_items, ndim, fastp
ath, placement)
     63         if len(items) != len(values):
     64             raise ValueError('Wrong number of items passed %d, indices imply '
---&gt; 65                              '%d' % (len(items), len(values)))
     66
     67         self.set_ref_locs(placement)

ValueError: Wrong number of items passed 1, indices imply 0
</code></pre></div>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import pandas as pd

ind = ['A', 'A', 'B', 'C']i
df = pd.DataFrame({'test':range(len(ind))}, index=ind)

rows = ['C', 'B']
res = df.ix[rows]
assert rows == list(res.index) # fails"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s1">pandas</span> <span class="pl-k">as</span> <span class="pl-s1">pd</span>

<span class="pl-s1">ind</span> <span class="pl-c1">=</span> [<span class="pl-s">'A'</span>, <span class="pl-s">'A'</span>, <span class="pl-s">'B'</span>, <span class="pl-s">'C'</span>]<span class="pl-s1">i</span>
<span class="pl-s1">df</span> <span class="pl-c1">=</span> <span class="pl-s1">pd</span>.<span class="pl-v">DataFrame</span>({<span class="pl-s">'test'</span>:<span class="pl-en">range</span>(<span class="pl-en">len</span>(<span class="pl-s1">ind</span>))}, <span class="pl-s1">index</span><span class="pl-c1">=</span><span class="pl-s1">ind</span>)

<span class="pl-s1">rows</span> <span class="pl-c1">=</span> [<span class="pl-s">'C'</span>, <span class="pl-s">'B'</span>]
<span class="pl-s1">res</span> <span class="pl-c1">=</span> <span class="pl-s1">df</span>.<span class="pl-s1">ix</span>[<span class="pl-s1">rows</span>]
<span class="pl-k">assert</span> <span class="pl-s1">rows</span> <span class="pl-c1">==</span> <span class="pl-en">list</span>(<span class="pl-s1">res</span>.<span class="pl-s1">index</span>) <span class="pl-c"># fails</span></pre></div>
<p dir="auto">The problem is that the resulting DataFrame keeps the ordering of the <code class="notranslate">df.index</code> and not the <code class="notranslate">rows</code> key. You'll notice that the <code class="notranslate">rows</code> key doesn't reference a duplicate value.</p>