Skip to content

API: selection from a duplicated index of a Series return a Series? #5678

Closed
@floux

Description

@floux

See below for discussion


In [19]: import pandas as pd

In [20]: import numpy as np

In [21]: import random

In [22]: df = pd.DataFrame(np.random.random_sample((20,5)), index=[random.choice('ABCDE') for x in range(20)])

In [23]: df.loc[:,0].ix['A'].median()
Out[23]: 0.57704085832236685

In [24]: pd.version.version
Out[24]: '0.12.0'


In [1]: import pandas as pd

In [2]: import numpy as np

In [3]: import random

In [4]: df = pd.DataFrame(np.random.random_sample((20,5)), index=[random.choice('ABCDE') for x in range(20)])

In [5]: df.loc[:,0].ix['A'].median()
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-5-57f9fc9d1583> in <module>()
----> 1 df.loc[:,0].ix['A'].median()

AttributeError: 'numpy.ndarray' object has no attribute 'median'

In [6]: pd.version.version
Out[6]: '0.13.0rc1-43-g4f9fefc'

Metadata

Metadata

Assignees

No one assigned

    Labels

    API DesignBugIndexingRelated to indexing on series/frames, not to indexes themselvesRegressionFunctionality that used to work in a prior pandas version

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions