Skip to content

Unstacking boolean DataFrame fills 'True' for missing values #1820

Closed
@warrenwjackson

Description

@warrenwjackson

Is this a bug? If this is intentional, it is pretty dangerous to fill missing values with True.

>>> df = pd.DataFrame([False, False], index=pd.MultiIndex.from_arrays([['a', 'b'], ['c', 'l']]), columns=['col'])
>>> df
       col
a c  False
b l  False
>>> df.unstack()
     col
       c      l
a  False   True
b   True  False

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugReshapingConcat, Merge/Join, Stack/Unstack, Explode

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions