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
DOC replace pandas with Polars in examples/gaussian_process/plot_gpr_co2.py #28804
Merged
Merged
Changes from 1 commit
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
77bdbd8
replace pandas with Polars for forecasting co2 example
72dd6ec
Merge branch 'main' of github.com:scikit-learn/scikit-learn into pola…
601e69a
Update examples/gaussian_process/plot_gpr_co2.py
raisadz 810056a
Merge branch 'main' of github.com:scikit-learn/scikit-learn into pola…
60612bf
Merge branch 'polars_co2_example' of github.com:raisadz/scikit-learn …
15f0c77
roll back to converting to NumPy as Polars 0.19.12 doesnt support pl.…
c423b91
use pl.DataFrame to convert from pandas, increase the minimum Polars …
ad3fd96
Merge remote-tracking branch 'upstream/main' into polars_co2_example
264452c
remove reshape as not needed anymore, resolve conflicts with upstream
3cab712
Merge remote-tracking branch 'upstream/main' into polars_co2_example
raisadz b2b6aef
resolve conflicts
raisadz File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do we need a round trip here?
pl.DataFrame(pd.DataFrame)
doesn't work?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your review. Converting from/to pandas requires pyarrow as a dependency, and because scikit-learn doesn't have it, the following error will occur when trying to convert a pandas dataframe to Polars:
There is an old related issue converting
pl.to_pandas
pola-rs/polars#3398There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Opened an issue on the polars side: pola-rs/polars#15845
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like we can do:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like
pl.from_dataframe
still needs pyarrow for older Polars versions and the checks fail for the minimum Polars version 0.19.12,There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we don't really depend on polars and it's only used in our CI for docs, I'd be in favor of moving the min version to something that supports this.
WDYT @ogrisel @thomasjpfan
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems that
pl.from_dataframe
works without pyarrow starting from Polars version 0.20.4. I can increase the minimum required Polars version from 0.19.12 to 0.20.4 if you prefer this option.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that'd be okay.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am okay with this option.