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

implement expand method for pandas #1371

Closed
wants to merge 10 commits into from
Closed

Conversation

samukweku
Copy link
Collaborator

PR Description

Please describe the changes proposed in the pull request:

  • implement expand method for pandas DataFrame
  • user can build DataFrame to compute missing values/gaps, instead of using complete (more power to the user)
  • updates to expand_grid - MultiIndex columns are generated only if the key lengths of the dictionaries differ (maybe a tuple was used, or the length of tuples differ)
  • expand_grid now uses np.indices for faster generation of indices, which is used to explode into a cartesian.
  • df_key is deprecated. The columns of df will be used instead as keys.

This PR resolves #1293 .

PR Checklist

Please ensure that you have done the following:

  1. PR in from a fork off your branch. Do not PR from <your_username>:dev, but rather from <your_username>:<feature-branch_name>.
  1. If you're not on the contributors list, add yourself to AUTHORS.md.
  1. Add a line to CHANGELOG.md under the latest version header (i.e. the one that is "on deck") describing the contribution.
    • Do use some discretion here; if there are multiple PRs that are related, keep them in a single line.

Automatic checks

There will be automatic checks run on the PR. These include:

  • Building a preview of the docs on Netlify
  • Automatically linting the code
  • Making sure the code is documented
  • Making sure that all tests are passed
  • Making sure that code coverage doesn't go down.

Relevant Reviewers

Please tag maintainers to review.

@ericmjl
Copy link
Member

ericmjl commented Jun 8, 2024

@samukweku
Copy link
Collaborator Author

I'll fix the failures after other PRs are ok.

@samukweku samukweku marked this pull request as draft June 8, 2024 08:09
@samukweku samukweku closed this Jul 4, 2024
@samukweku samukweku deleted the samukweku/expand_grid_refactor branch July 4, 2024 09:02
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.

expand function
2 participants