Skip to content

Dataframe partition method #23252

Description

@ratmice

Is your feature request related to a problem or challenge?

Currently I use do a couple of dataframe.filter calls, when a single pass might be more efficient

let matches_df = df.clone().filter(expr.clone());
let inverse_matches_df = df.clone().filter(expr.is_not_true());

It could be nice if there was a function let (matches_df, inverse_matches_df) = df.partition(expr);
if it could produce both dataframes in a single pass from the filter expression.

Describe the solution you'd like

No response

Describe alternatives you've considered

The running two filters does actually work, but a dedicated function might be clearer and could be more efficient.

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Fields

    No fields configured for Feature.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions