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

[ENH] improve performance for polars' pivot_longer #1377

Merged
merged 31 commits into from
Jul 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
ed3ff67
faster pivot_longer for non dot value
Jun 17, 2024
1568143
fix docs and tests
Jun 18, 2024
b5a89a9
fix docs and tests
Jun 18, 2024
ddfc230
Merge dev into samukweku/polars_pivot_longer_improve
ericmjl Jun 18, 2024
58b2912
Merge dev into samukweku/polars_pivot_longer_improve
ericmjl Jun 18, 2024
c20838b
Merge dev into samukweku/polars_pivot_longer_improve
ericmjl Jun 18, 2024
f2e761c
Merge dev into samukweku/polars_pivot_longer_improve
ericmjl Jun 19, 2024
5278936
fix doc
Jun 20, 2024
e8c3057
fix doc pivot_longer_spec
Jun 20, 2024
7c497cd
fix doc pivot_longer_spec
Jun 20, 2024
9fecc2b
Merge remote-tracking branch 'origin/dev' into samukweku/polars_pivot…
Jun 20, 2024
513fe73
updates
Jun 20, 2024
2399484
updates
Jun 20, 2024
49fc638
updates
Jun 20, 2024
6107948
fix docs
Jun 20, 2024
f2b956b
fix tests
Jun 20, 2024
d849cff
change sort logic for `complete`
Jun 22, 2024
aee2b09
updates to complete
Jun 22, 2024
6a5f66e
restore inital setup for complete
Jun 22, 2024
8ea3f56
remove dead code
Jun 22, 2024
cf350a3
use left join
Jun 23, 2024
8fe093c
update docs for pivot_longer
Jun 26, 2024
8dd1d82
WIP - expand
Jun 27, 2024
83296d1
Delete janitor/polars/expand.py
samukweku Jun 27, 2024
f1fab2e
remove expand
Jun 27, 2024
2b98614
remove expand
Jun 27, 2024
aecc4c2
Merge dev into samukweku/polars_pivot_longer_improve
ericmjl Jun 28, 2024
1fc553e
Merge dev into samukweku/polars_pivot_longer_improve
ericmjl Jun 28, 2024
a028079
Merge dev into samukweku/polars_pivot_longer_improve
ericmjl Jul 3, 2024
a9e344c
Merge dev into samukweku/polars_pivot_longer_improve
ericmjl Jul 3, 2024
08fe245
Merge dev into samukweku/polars_pivot_longer_improve
ericmjl Jul 4, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions janitor/polars/complete.py
Original file line number Diff line number Diff line change
Expand Up @@ -385,14 +385,14 @@ def _complete(

no_columns_to_fill = set(df.columns) == set(uniques.columns)
if fill_value is None or no_columns_to_fill:
return uniques.join(df, on=uniques.columns, how="full", coalesce=True)
return uniques.join(df, on=uniques.columns, how="left", coalesce=True)
idx = None
columns_to_select = df.columns
if not explicit:
idx = "".join(df.columns)
idx = f"{idx}_"
df = df.with_row_index(name=idx)
df = uniques.join(df, on=uniques.columns, how="full", coalesce=True)
df = uniques.join(df, on=uniques.columns, how="left", coalesce=True)
# exclude columns that were not used
# to generate the combinations
exclude_columns = uniques.columns
Expand Down
Loading
Loading