Skip to content

DEPR: DataFrame.__getitem__[str] sometimes slices on index #31476

@jbrockmendel

Description

@jbrockmendel
Member

xref #31334, #9595

  • This is a tiny corner case, at least as measured by tests cases (2 tests reach this)
  • With this removed, the __getitem__ API becomes much simpler to describe: "DataFrame.getitem` is always column-based"

Activity

added
DeprecateFunctionality to remove in pandas
IndexingRelated to indexing on series/frames, not to indexes themselves
on Jan 31, 2020
jorisvandenbossche

jorisvandenbossche commented on Jan 31, 2020

@jorisvandenbossche
Member

@jbrockmendel Can you be more clear or specific in the description of the issue? And give some examples of the behaviour you want to deprecate?

For example: do you want to deprecate all slicing in __getitem__, or only the slicing with a single string? Because in #31334, you never mentioned it is only about "single string" slicing, while the title here suggest otherwise.

With this removed, the getitem API becomes much simpler to describe: "DataFrame.getitem` is always column-based"

Assuming you only mean "partial datetime string slicing with a single string", note that __getitem__ still does row-based access (normal slicing, boolean masks). So the "getitem is always column-based" is a bit confusing. I suppose you mean: when passing a single, scalar label, it is always column-based.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    DeprecateFunctionality to remove in pandasIndexingRelated to indexing on series/frames, not to indexes themselvesNeeds DiscussionRequires discussion from core team before further action

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      Participants

      @jorisvandenbossche@jbrockmendel

      Issue actions

        DEPR: DataFrame.__getitem__[str] sometimes slices on index · Issue #31476 · pandas-dev/pandas