Skip to content

Breaking change multiplication bool and int #22047

Closed
@Tux1

Description

@Tux1

Code Sample, a copy-pastable example if possible

import pandas as pd
a = pd.DataFrame([[False, True], [False, False]])
print(a.dtypes)
b = a * 1
print(b.dtypes)

Problem description

With 0.20.3, I get b as DataFrame int32.
With 0.23.3, I get b as DataFrame object.

Expected Output

With 0.20.3

a.dtypes =
0 bool
1 bool
dtype: object

b.dtypes =
0 int32
1 int32
dtype: object

With 0.23.3

a.dtypes =
0 bool
1 bool
dtype: object

b.dtypes =
0 object
1 object
dtype: object

Versions

pandas 0.20.3 vs pandas 0.23.3

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