Skip to content

DataFrame.unstack() issues DeprecationWarning with MultiIndex #11162

Closed
@xflr6

Description

@xflr6
>>> import warnings
>>> warnings.simplefilter('error')

>>> import pandas as pd
>>> pd.__version__
u'0.17.0rc1'

>>> df = pd.DataFrame({'A': list('aabb'), 'B': [0, 1, 0, 1], 'C': range(4)})
>>> gf = df.groupby(['A', 'B']).sum()
>>> gf
     C
A B   
a 0  0
  1  1
b 0  2
  1  3

>>> gf.unstack()
Traceback (most recent call last):
..., line 4274, in _reference_duplicate_name
    return np.sum(name == np.asarray(self.names)) > 1
DeprecationWarning: elementwise == comparison failed; this will raise an error in the future.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Compatpandas objects compatability with Numpy or Python functions

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions