Skip to content

groupby methods can return Series or DataFrame based on as_index variable #1025

Closed
@loicdiridollou

Description

@loicdiridollou

Describe the bug
Depending on the boolean as_index, methods on groupby objects will return different type.
This is a follow up for #203,

To Reproduce

  1. Provide a minimal runnable pandas example that is not properly checked by the stubs.
  2. Indicate which type checker you are using (mypy or pyright).
  3. Show the error message received from that type checker while checking your example.

Please complete the following information:

  • OS: [e.g. Windows, Linux, MacOS]
  • OS Version [e.g. 22]
  • python version
  • version of type checker
  • version of installed pandas-stubs

Additional context
Add any other context about the problem here.

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