BUG: duplicate selection with missing values raises · Issue #5835 · pandas-dev/pandas (original) (raw)

Hard to reprod.

Select from a duplicate indexed axis in a frame with ix where part of the
selection set is missing

In [22]: df = DataFrame(np.random.randn(5,5),columns=['A.1','B.1','B.2','B.3','A.2'],index=date_range('20130101',periods=5))

In [23]: df2 = df.rename(columns=lambda x: x.split('.')[0])

In [24]: df2
Out[24]: 
                   A         B         B         B         A
2013-01-01 -1.029245 -0.782139  0.584956  1.097301 -0.150675
2013-01-02 -0.723246 -0.356150 -0.441952  0.027012 -1.851583
2013-01-03 -1.001412  0.129464  0.093433  0.952615 -1.338390
2013-01-04  0.165987  0.227918  0.557940 -0.102501 -1.194053
2013-01-05  0.249493 -1.102096 -0.977755 -0.529540  0.783277

[5 rows x 5 columns]

In [25]: df2.ix[:,['A','B','C']]

AssertionError: Number of manager items must equal union of block items
# manager items: 6, # tot_items: 14