fix: handle empty value_counts in get_most_frequent to prevent IndexError#811
fix: handle empty value_counts in get_most_frequent to prevent IndexError#811vivek41-glitch wants to merge 1 commit into
Conversation
|
Hi maintainers! 👋 |
|
thanks for your PR! i need to check where this function is used, and what if the |
|
Hey! Thanks for looking at this. |
|
yes, please check the call stack, thx! |
|
Sure thing! Give me a few minutes to trace through the code and I'll post what I find. |
|
Hey @pplonski, |
|
if there are no internal callers ... then we dont need this function |
|
You're right that the function has no internal callers. However, it's a public utility function that users might be relying on in their own code. Deleting it would be a breaking change for anyone using get_most_frequent() externally. |
|
Hi @pplonski, just checking in. Do you prefer to:
|
Fixes #770
Problem
get_most_frequent()inpreprocessing_utils.pycrashes withIndexError: list index out of rangewhenvalue_counts()returns an empty Series. This happens during preprocessing when a column has no valid values.Root Cause
Fix
Impact