Future-proof helper function with zero handling.#107798
Future-proof helper function with zero handling.#107798rhettinger merged 1 commit intopython:mainfrom
Conversation
The ZeroDivisionError was already being caught in correlation(), but it is nicer to handle the zero case inside the helper function.
|
Any tests? What about |
In the previous PR, there was a script to demonstrate that the results are generally improved. Otherwise, I'm relying on the existing tests for
This could be a future improvement. Off-hand I don't see an elegant way to do this without a bunch of conditional logic and rescaling, but I'll put some thought into it. For now, it is on the bottom of my priority list. |
|
I see. Thank you for details. Could you please include issue number in future PRs title. I sometimes dig through the history of the code and find changes that do not have references to issue. It's very hard to understand the context without it. |
The ZeroDivisionError was already being caught in correlation(), but it is nicer to handle the zero case inside the helper function.