-
Notifications
You must be signed in to change notification settings - Fork 28.3k
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
[SPARK-49382][PS] Make frame box plot properly render the fliers/outliers #47866
Closed
Conversation
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
HyukjinKwon
approved these changes
Aug 26, 2024
zhengruifeng
changed the title
[SPARK-49382][PS] Make frame box plot properly render the fliers/outlier
[SPARK-49382][PS] Make frame box plot properly render the fliers/outliers
Aug 26, 2024
zhengruifeng
commented
Aug 26, 2024
for i, colname in enumerate(colnames): | ||
formated_colname = "`{}`".format(colname) | ||
outlier_colname = "__{}_outlier".format(colname) | ||
min_val = multicol_whiskers[colname]["min"] |
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 feel it weird to select the outliers by the distance |value - lower_whisker|
, which is used in series.boxplot.
It should be something like |value - median|
or |value - mean|
, will revisit this later.
merged to master |
IvanK-db
pushed a commit
to IvanK-db/spark
that referenced
this pull request
Sep 20, 2024
…iers ### What changes were proposed in this pull request? fliers/outliers was ignored in the initial implementation apache#36317 ### Why are the changes needed? feature parity for Pandas and Series box plot ### Does this PR introduce _any_ user-facing change? ``` import pyspark.pandas as ps df = ps.DataFrame([[5.1, 3.5, 0], [4.9, 3.0, 0], [7.0, 3.2, 1], [6.4, 3.2, 1], [5.9, 3.0, 2], [100, 200, 300]], columns=['length', 'width', 'species']) df.boxplot() ``` `df.length.plot.box()` ![image](https://github.com/user-attachments/assets/43da563c-5f68-4305-ad27-a4f04815dfd1) before: `df.boxplot()` ![image](https://github.com/user-attachments/assets/e25c2760-c12a-4801-a730-3987a020f889) after: `df.boxplot()` ![image](https://github.com/user-attachments/assets/c19f13b1-b9e4-423e-bcec-0c47c1c8df32) ### How was this patch tested? CI and manually check ### Was this patch authored or co-authored using generative AI tooling? No Closes apache#47866 from zhengruifeng/plot_hist_fly. Authored-by: Ruifeng Zheng <ruifengz@apache.org> Signed-off-by: Ruifeng Zheng <ruifengz@apache.org>
attilapiros
pushed a commit
to attilapiros/spark
that referenced
this pull request
Oct 4, 2024
…iers ### What changes were proposed in this pull request? fliers/outliers was ignored in the initial implementation apache#36317 ### Why are the changes needed? feature parity for Pandas and Series box plot ### Does this PR introduce _any_ user-facing change? ``` import pyspark.pandas as ps df = ps.DataFrame([[5.1, 3.5, 0], [4.9, 3.0, 0], [7.0, 3.2, 1], [6.4, 3.2, 1], [5.9, 3.0, 2], [100, 200, 300]], columns=['length', 'width', 'species']) df.boxplot() ``` `df.length.plot.box()` ![image](https://github.com/user-attachments/assets/43da563c-5f68-4305-ad27-a4f04815dfd1) before: `df.boxplot()` ![image](https://github.com/user-attachments/assets/e25c2760-c12a-4801-a730-3987a020f889) after: `df.boxplot()` ![image](https://github.com/user-attachments/assets/c19f13b1-b9e4-423e-bcec-0c47c1c8df32) ### How was this patch tested? CI and manually check ### Was this patch authored or co-authored using generative AI tooling? No Closes apache#47866 from zhengruifeng/plot_hist_fly. Authored-by: Ruifeng Zheng <ruifengz@apache.org> Signed-off-by: Ruifeng Zheng <ruifengz@apache.org>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What changes were proposed in this pull request?
fliers/outliers was ignored in the initial implementation #36317
Why are the changes needed?
feature parity for Pandas and Series box plot
Does this PR introduce any user-facing change?
df.length.plot.box()
before:
df.boxplot()
after:
df.boxplot()
How was this patch tested?
CI and manually check
Was this patch authored or co-authored using generative AI tooling?
No