Skip to content

Error with all boolean indices for Series #8522

Closed
@ducky427

Description

@ducky427

The following code works fine with pandas 0.14.1

import pandas as pd
pd.Series([1, 1], index=[True, False]).drop(True)

Output:

False    1
dtype: int64

In pandas 0.15rc1, the code blows up and produces the following error:

ValueError                                Traceback (most recent call last)
<ipython-input-35-f9a275b6ce2c> in <module>()
----> 1 pd.Series([1, 1], index=[True, False]).drop(True)

/home/d/.virtualenvs/test/local/lib/python2.7/site-packages/pandas-0.15.0rc1-py2.7-linux-x86_64.egg/pandas/core/generic.pyc in drop(self, labels, axis, level, inplace, **kwargs)
   1531         axis, axis_ = self._get_axis(axis), axis
   1532 
-> 1533         if axis.is_unique:
   1534             if level is not None:
   1535                 if not isinstance(axis, MultiIndex):

/home/d/.virtualenvs/test/local/lib/python2.7/site-packages/pandas-0.15.0rc1-py2.7-linux-x86_64.egg/pandas/lib.so in pandas.lib.cache_readonly.__get__ (pandas/lib.c:38943)()

/home/d/.virtualenvs/test/local/lib/python2.7/site-packages/pandas-0.15.0rc1-py2.7-linux-x86_64.egg/pandas/core/index.pyc in is_unique(self)
    582     def is_unique(self):
    583         """ return if the index has unique values """
--> 584         return self._engine.is_unique
    585 
    586     def is_integer(self):

/home/d/.virtualenvs/test/local/lib/python2.7/site-packages/pandas-0.15.0rc1-py2.7-linux-x86_64.egg/pandas/index.so in pandas.index.IndexEngine.is_unique.__get__ (pandas/index.c:4449)()

/home/d/.virtualenvs/test/local/lib/python2.7/site-packages/pandas-0.15.0rc1-py2.7-linux-x86_64.egg/pandas/index.so in pandas.index.IndexEngine._do_unique_check (pandas/index.c:4901)()

/home/d/.virtualenvs/test/local/lib/python2.7/site-packages/pandas-0.15.0rc1-py2.7-linux-x86_64.egg/pandas/index.so in pandas.index.IndexEngine._ensure_mapping_populated (pandas/index.c:5106)()

/home/d/.virtualenvs/test/local/lib/python2.7/site-packages/pandas-0.15.0rc1-py2.7-linux-x86_64.egg/pandas/index.so in pandas.index.IndexEngine.initialize (pandas/index.c:5203)()

/home/d/.virtualenvs/test/local/lib/python2.7/site-packages/pandas-0.15.0rc1-py2.7-linux-x86_64.egg/pandas/hashtable.so in pandas.hashtable.PyObjectHashTable.map_locations (pandas/hashtable.c:12440)()

ValueError: Does not understand character buffer dtype format string ('?')

Is this the expected behaviour in the new release?

cheers

Metadata

Metadata

Assignees

No one assigned

    Labels

    Dtype ConversionsUnexpected or buggy dtype conversionsIndexingRelated to indexing on series/frames, not to indexes themselvesRegressionFunctionality that used to work in a prior pandas version

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions