Skip to content

Series boolean intersection not label based #4947

Closed
@hayd

Description

@hayd

http://stackoverflow.com/questions/18952544/in-python-pandas-boolean-operation

In [1]: a = pd.Series([True, False, True], list('bca'))

In [2]: b = pd.Series([False, True, False], list('abc'))

In [3]: a & b
Out[3]:
b    False
c    False
a    False
dtype: bool

Expected to use labels:

In [6]: index = a.index | b.index

In [7]: a.reindex(index) & b.reindex(index)
Out[7]:
a    False
b     True
c    False
dtype: bool

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