Skip to content

API: support multiple indexers for .iloc with a MultiIndex #7490

Closed
@shoyer

Description

@shoyer

MultIndexing with multiple indexers (#6301) via .loc is great.

It would be nice to mirror this functionality with .iloc.

To my understanding, until this change, loc and iloc had a mirror syntax, where if you replaced all of your index labels with arrays of 0-indexed integers, they were equivalent, e.g., for the following series:

import pandas as pd
midx = pd.MultiIndex.from_product([range(3), range(5)])
s = pd.Series(range(15), midx)

Now they lack this symmetry, because indexing like s.iloc[0, 0] doesn't work like s.loc[0, 0]. I found this surprising. Thoughts?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions