Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reimplement .dropna() using MapReduce pattern #6433

Closed
dchigarev opened this issue Jul 31, 2023 · 0 comments · Fixed by #6472
Closed

Reimplement .dropna() using MapReduce pattern #6433

dchigarev opened this issue Jul 31, 2023 · 0 comments · Fixed by #6472
Assignees
Labels
new feature/request 💬 Requests and pull requests for new features P1 Important tasks that we should complete soon Performance 🚀 Performance related issues and pull requests.

Comments

@dchigarev
Copy link
Collaborator

Currently, it's implemented as a full-axis function, which works terribly slow in case we want to perform dropna along columns.

We can simply rewrite .dropna() using MapReduce pattern, which should significantly improve performance.

It's proposed to write something like this:

# pandas query compiler
def dropna(self, **kwargs):
    masks = self._modin_frame.map(
        func=lambda df: df.isna().all()
    )

    def func(df, *masks):
        non_nan_cols = conjunction_masks(masks)                
        return df[non_nan_cols]
    
    result = self._modin_frame.map_with_broadcast(func, masks)
    return self.__constructor__(result)
@dchigarev dchigarev added Performance 🚀 Performance related issues and pull requests. new feature/request 💬 Requests and pull requests for new features P1 Important tasks that we should complete soon labels Jul 31, 2023
@dchigarev dchigarev self-assigned this Jul 31, 2023
dchigarev added a commit to dchigarev/modin that referenced this issue Aug 8, 2023
Signed-off-by: Dmitry Chigarev <dmitry.chigarev@intel.com>
dchigarev added a commit to dchigarev/modin that referenced this issue Aug 8, 2023
Signed-off-by: Dmitry Chigarev <dmitry.chigarev@intel.com>
YarShev pushed a commit that referenced this issue Aug 21, 2023
Signed-off-by: Dmitry Chigarev <dmitry.chigarev@intel.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new feature/request 💬 Requests and pull requests for new features P1 Important tasks that we should complete soon Performance 🚀 Performance related issues and pull requests.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant