Skip to content

Conversation

iabhi4
Copy link
Contributor

@iabhi4 iabhi4 commented May 30, 2025

Fixes a bug in DataFrame.sort_values where sorting by a column explicitly named None raised a KeyError. Added a conditional check to correctly retrieve and sort the column when None is used as a label.

@iabhi4 iabhi4 force-pushed the fix/sort-by-none-column branch 3 times, most recently from 39aecc7 to 4244b96 Compare May 30, 2025 02:08
@iabhi4 iabhi4 force-pushed the fix/sort-by-none-column branch from 4244b96 to 488423b Compare May 30, 2025 18:07
@iabhi4 iabhi4 requested a review from mroeschke May 30, 2025 18:09
@iabhi4 iabhi4 force-pushed the fix/sort-by-none-column branch from 488423b to 9d71f50 Compare May 30, 2025 18:13
@iabhi4 iabhi4 force-pushed the fix/sort-by-none-column branch from 9d71f50 to e6e33c4 Compare May 30, 2025 21:44
@iabhi4 iabhi4 requested a review from mroeschke May 30, 2025 23:43
@mroeschke mroeschke added the Algos Non-arithmetic algos: value_counts, factorize, sorting, isin, clip, shift, diff label Jun 2, 2025
@mroeschke mroeschke added this to the 3.0 milestone Jun 2, 2025
@mroeschke mroeschke merged commit 279f597 into pandas-dev:main Jun 2, 2025
47 checks passed
@mroeschke
Copy link
Member

Thanks @iabhi4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Algos Non-arithmetic algos: value_counts, factorize, sorting, isin, clip, shift, diff
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: Cannot sort by columns named None
2 participants