As written in the title, I need to replace -inf
values within a pandas data frame. I would like to replace them by nan-values. There are multiple columns containing -inf
so it should be run over the whole data frame.
I tried df.replace(np.inf, np.nan)
which only seems to work with positive infinity. Also tried df.replace('-inf', np.nan)
.
How do I replace negative infinity values in my dataframe?