[SPARK-55662][PS] Implementation of idxmin Axis argument#54455
Open
devin-petersohn wants to merge 2 commits intoapache:masterfrom
Open
[SPARK-55662][PS] Implementation of idxmin Axis argument#54455devin-petersohn wants to merge 2 commits intoapache:masterfrom
devin-petersohn wants to merge 2 commits intoapache:masterfrom
Conversation
Signed-off-by: Devin Petersohn <devin.petersohn@gmail.com> Co-authored-by: Devin Petersohn <devin.petersohn@snowflake.com>
Member
|
cc @ueshin @gaogaotiantian FYI |
ueshin
reviewed
Feb 26, 2026
| column_labels = self._internal.column_labels | ||
|
|
||
| if len(column_labels) == 0: | ||
| return ps.Series([], dtype=np.int64) |
Member
There was a problem hiding this comment.
This seems different from idxmax. Could you confirm?
| ) | ||
|
|
||
| result = None | ||
| for label in reversed(column_labels): |
Member
There was a problem hiding this comment.
Could you also add a comment here?
Comment on lines
+12569
to
+12572
| sdf = self._internal.spark_frame.select( | ||
| *self._internal.index_spark_columns, | ||
| result.alias(SPARK_DEFAULT_SERIES_NAME), | ||
| ) |
Member
There was a problem hiding this comment.
Shall we also use self._internal.with_new_columns to avoid creating a new Spark DataFrame?
This file contains hidden or 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
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?
Add axis=1 support for DataFrame.idxmin, matching the existing idxmax axis=1 implementation.
Why are the changes needed?
Implements missing API parameter
Does this PR introduce any user-facing change?
Yes, new parameter
How was this patch tested?
CI
Was this patch authored or co-authored using generative AI tooling?
Co-authored-by: Claude Opus 4