Skip to content

DIfferent result between master and from latest pandas version #29422

Closed
@charlesdong1991

Description

@charlesdong1991

related #28201

I find out the result gotten from pandas master is different from using a specific version recently

Also, minimum reproducible example:

df = pd.DataFrame({"group": ['a', 'a', 'b', 'b'], "A": [0, 1, 2, 3], "B": [5, 6, 7, 8]})
df.columns = pd.MultiIndex.from_tuples([('x', 'group'), ('y', 'A'), ('y', 'B')])

if running the code below on pandas master:

df.groupby(('x', 'group')).agg(a_max=(('y', 'A'), "max"))

Screen Shot 2019-11-05 at 11 25 45 PM

But if running the same code in pandas==0.25.3, then will get the error:

ValueError: operands could not be broadcast together with shapes (1,2) (3,) (1,2) 

I didn't find any PRs since 0.25.3 was released related to this issue, so curious why this was caused.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs TestsUnit test(s) needed to prevent regressions

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions