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

Wrap dropna #26

Merged
merged 9 commits into from
Apr 11, 2024
Merged

Wrap dropna #26

merged 9 commits into from
Apr 11, 2024

Conversation

dougbrn
Copy link
Collaborator

@dougbrn dougbrn commented Apr 10, 2024

Change Description

Solution Description

Wraps dropna and enables hierarchical column names to work within the subset kwarg. Additionally, adds the on_nested kwarg to allow users to specify a nested layer to use dropna on, the motivation being that a user just wants to run on a layer and doesn't want to use a subset of columns within that layer.

Code Quality

  • I have read the Contribution Guide
  • My code follows the code style of this project
  • My code builds (or compiles) cleanly without any errors or warnings
  • My code contains relevant comments and necessary documentation

Project-Specific Pull Request Checklists

Bug Fix Checklist

  • My fix includes a new test that breaks as a result of the bug (if possible)
  • My change includes a breaking change
    • My change includes backwards compatibility and deprecation warnings (if possible)

New Feature Checklist

  • I have added or updated the docstrings associated with my feature using the NumPy docstring format
  • I have updated the tutorial to highlight my new feature (if appropriate)
  • I have added unit/End-to-End (E2E) test cases to cover my new feature
  • My change includes a breaking change
    • My change includes backwards compatibility and deprecation warnings (if possible)

Documentation Change Checklist

Build/CI Change Checklist

  • If required or optional dependencies have changed (including version numbers), I have updated the README to reflect this
  • If this is a new CI setup, I have added the associated badge to the README

Other Change Checklist

  • Any new or updated docstrings use the NumPy docstring format.
  • I have updated the tutorial to highlight my new feature (if appropriate)
  • I have added unit/End-to-End (E2E) test cases to cover any changes
  • My change includes a breaking change
    • My change includes backwards compatibility and deprecation warnings (if possible)

Copy link

github-actions bot commented Apr 10, 2024

Before [b822a14] After [28f018d] Ratio Benchmark (Parameter)
1.44±0.6s 3.00±0.8s ~2.08 benchmarks.time_computation
4.08k 1.8k 0.44 benchmarks.mem_list

Click here to view all benchmarks.

@dougbrn dougbrn marked this pull request as ready for review April 10, 2024 21:02
Copy link

codecov bot commented Apr 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.92%. Comparing base (b822a14) to head (b63a49c).

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #26      +/-   ##
==========================================
+ Coverage   94.49%   94.92%   +0.43%     
==========================================
  Files          13       13              
  Lines         563      611      +48     
==========================================
+ Hits          532      580      +48     
  Misses         31       31              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@dougbrn dougbrn requested a review from hombit April 10, 2024 21:08
Copy link
Collaborator

@hombit hombit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, it is great!

src/nested_pandas/nestedframe/core.py Show resolved Hide resolved
src/nested_pandas/nestedframe/core.py Outdated Show resolved Hide resolved
src/nested_pandas/nestedframe/core.py Outdated Show resolved Hide resolved
src/nested_pandas/nestedframe/core.py Outdated Show resolved Hide resolved
src/nested_pandas/nestedframe/core.py Outdated Show resolved Hide resolved
src/nested_pandas/nestedframe/core.py Outdated Show resolved Hide resolved
src/nested_pandas/nestedframe/core.py Outdated Show resolved Hide resolved
src/nested_pandas/nestedframe/core.py Show resolved Hide resolved
src/nested_pandas/nestedframe/core.py Outdated Show resolved Hide resolved
src/nested_pandas/nestedframe/core.py Outdated Show resolved Hide resolved
dougbrn and others added 2 commits April 11, 2024 09:11
Co-authored-by: Konstantin Malanchev <hombit@gmail.com>
Co-authored-by: Konstantin Malanchev <hombit@gmail.com>
Copy link
Contributor

@wilsonbb wilsonbb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just some drive-by comments since I was reading the PR to understand the current nested-pandas state.

A more general comment: I would assume as a user I would be interested in trying something like

df.dropna(axis='columns', on_nested=True)

and that it would drop NaNs from all of the base columns as well as all of the columns in each of the nested frames. But it looks like this isn't currently possible with the requirement that that we only target on nested structure though I may be reading incorrectly. Not necessarily a blocker for a MVP, but wanted to comment on my surprise

src/nested_pandas/nestedframe/core.py Outdated Show resolved Hide resolved
@dougbrn dougbrn merged commit d63cee9 into main Apr 11, 2024
11 checks passed
@dougbrn dougbrn deleted the wrap_dropna branch April 11, 2024 19:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MVP: Wrapping dropna
3 participants