A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/pandas-dev/pandas/issues/8445 below:

DataFrame division returns infinity for 0

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