Open
Description
Pandas version checks
-
I have checked that this issue has not already been reported.
-
I have confirmed this bug exists on the latest version of pandas.
-
I have confirmed this bug exists on the main branch of pandas.
Reproducible Example
import numpy as np, pandas as pd
x = np.array([0.0, 1.0])
df = pd.DataFrame(x, columns=["x"])
np.log10(x, out=np.zeros_like(x), where=x>0) # no warning, expected result ([0, 0])
np.log10(df.x, where=x>0) # no warning, usually incorrect result
np.log10(df.x, out=np.zeros_like(x), where=x>0) # warning, correct result
Issue Description
Warning:
Python\Python310\lib\site-packages\pandas\core\arraylike.py:397: RuntimeWarning: divide by zero encountered in log10
result = getattr(ufunc, method)(*inputs, **kwargs)
Expected Behavior
No warning
Installed Versions
(show_versions()
fails with assert '_distutils' in core.file, core.file)
Pandas 1.4.1 from pip and pandas-1.5.0.dev0+583.g5414a2d59 from GitHub