xref #9286
0 / 0 does not have a value, and should return NaN, not infinity.
>>> x = pd.DataFrame([[0, 0], [1, 0], [-1, 0]]) >>> x[0] / x[1] 0 inf <------------- here 1 inf 2 -inf dtype: float64
numpy does this correctly:
>>> y = np.array([[0, 0], [1, 0], [-1, 0]]) >>> y[:, 0] / y[:, 1] array([ nan, inf, -inf])
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4