Skip to content

assignment with index broken #1942

@CRP

Description

@CRP
a=DataFrame(randn(20,2),index=[chr(x+65) for x in range(20)])

a.ix[-1]=a.ix[-2]

---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-49-79d0c89159f2> in <module>()
----> 1 a.ix[-1]=a.ix[-2]

/usr/local/lib/python2.7/site-packages/pandas/core/indexing.pyc in __setitem__(self, key, value)
     80             indexer = self._convert_to_indexer(key)
     81 
---> 82         self._setitem_with_indexer(indexer, value)
     83 
     84     def _convert_tuple(self, key):

/usr/local/lib/python2.7/site-packages/pandas/core/indexing.pyc in _setitem_with_indexer(self, indexer, value)
    134                 value = self._align_frame(indexer, value)
    135 
--> 136             self.obj.values[indexer] = value
    137 
    138     def _align_series(self, indexer, ser):

ValueError: operands could not be broadcast together with shapes (2) (20) 

 pandas.__version__
Out[51]: '0.9.0.dev-ba93669'

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions