Skip to content

TST: add additional test cases for pivot_table with categorical data #21370

Closed
@jorisvandenbossche

Description

@jorisvandenbossche

xref #21252 (comment)

Add additional test cases for:

Using the same definition of df as you used in your test, columns/values is incorrect:

In [3]: pd.__version__
Out[3]: '0.23.0'

In [4]: df.pivot_table(columns='A', values='B')
Out[4]:
A  NaN  low
B  2.0  3.0

Similarly index/columns/values is incorrect:

In [5]: df['AA'] = df['A']

In [6]: df.pivot_table(index='A', columns='AA', values='B')
Out[6]:
AA   NaN  low
A
NaN  2.0  NaN
low  NaN  3.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    Testingpandas testing functions or related to the test suitegood first issue

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions