I am trying to find a mean of spesific column in a dataframe but I take -inf as a result what is that mean ?
df [df["col_name1"] == 0]["col_name1"].mean()
result : -inf
I am trying to find a mean of spesific column in a dataframe but I take -inf as a result what is that mean ?
df [df["col_name1"] == 0]["col_name1"].mean()
result : -inf
It's "negative infinity", which is the result of IEEE 754 directed roundings
in stock Python
>>> -math.inf
-inf
and in Pandas/NumPy
>>> import numpy as np
>>> np.Inf
inf
Example of directed rounding
>>> a = 1 * math.inf
>>> a + 100
inf
>>> -a + 100
-inf