Skip to content

Simplify *Series.hist #2487

@dangotbanned

Description

@dangotbanned

All three implementations are breaking some rules.

I haven't spent much time thinking on a good solution, but we should probably:

  • Identify common behavior
    • E.g. are they all following similar/the same steps?
  • See if we can pattern this into a CompliantHist (working title) protocol

@requires.backend_version((13,))
def hist( # noqa: C901, PLR0912, PLR0915
self,
bins: list[float | int] | None,
*,
bin_count: int | None,
include_breakpoint: bool,
) -> ArrowDataFrame:

def hist( # noqa: C901, PLR0912
self,
bins: list[float | int] | None,
*,
bin_count: int | None,
include_breakpoint: bool,
) -> PandasLikeDataFrame:

def hist( # noqa: C901, PLR0912
self,
bins: list[float | int] | None,
*,
bin_count: int | None,
include_breakpoint: bool,
) -> PolarsDataFrame:

Metadata

Metadata

Assignees

No one assigned

    Labels

    pandas-likeIssue is related to pandas-like backendspolarsIssue is related to polars backendpyarrowIssue is related to pyarrow backend

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions