You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Applying np.log() elementwise to a list of values within a rolling window results in weird behaviour if np.inf is calculated within a window. Applying np.log() or calling .log() on the column yields the appropriate elementwise log values (0 is mapped to -inf appropriately). Calling .mean() on the numpy constructed list yields the correct value once the -inf drops out of the window, but then produces NaN for every row afterwards (until the next -inf drops out of the window, whereby a correct value is again produced before continuing with NaNs). Calling .mean() on the list of log-values constructed by calling .log() produces expected behaviour.
Expected behavior
Using np.log() and calling .log() should have the same behaviour within the .rolling() window.
Checks
Reproducible example
Log output
Issue description
Applying
np.log()
elementwise to a list of values within a rolling window results in weird behaviour ifnp.inf
is calculated within a window. Applyingnp.log()
or calling.log()
on the column yields the appropriate elementwise log values (0 is mapped to -inf appropriately). Calling.mean()
on the numpy constructed list yields the correct value once the-inf
drops out of the window, but then produces NaN for every row afterwards (until the next -inf drops out of the window, whereby a correct value is again produced before continuing with NaNs). Calling.mean()
on the list of log-values constructed by calling.log()
produces expected behaviour.Expected behavior
Using
np.log()
and calling.log()
should have the same behaviour within the.rolling()
window.Installed versions
The text was updated successfully, but these errors were encountered: