Skip to content

Commit

Permalink
Re-word whatsnew entry; use compat.PY3
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Grady committed Jun 22, 2017
1 parent 9999269 commit 400fb56
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion doc/source/whatsnew/v0.21.0.txt
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ Sparse
Reshaping
^^^^^^^^^

- `{arg,idx}{min,max}` on Series, DataFrame, and GroupBy objects work correctly with float data that contains infinite values (:issue:`13595`), and with string data as long as it does not have any missing values.
- `argmin`, `argmax`, `idxmin`, and `idxmax` on Series, DataFrame, and GroupBy objects work correctly with floating point data that contains infinite values (:issue:`13595`). These functions now also work with string data, as long as there are no missing values.

Numeric
^^^^^^^
Expand Down
14 changes: 7 additions & 7 deletions pandas/tests/series/test_operators.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
from pandas.core.indexes.timedeltas import Timedelta
import pandas.core.nanops as nanops

from pandas.compat import range, zip
from pandas.compat import range, zip, PY3
from pandas import compat
from pandas.util.testing import (assert_series_equal, assert_almost_equal,
assert_frame_equal, assert_index_equal)
Expand Down Expand Up @@ -1910,12 +1910,7 @@ def test_argminmax(self):
# and raise a TypeError.
s = pd.Series(['foo', 'foo', 'bar', 'bar', None, np.nan, 'baz'])

if sys.version_info[0] < 3:
assert s.argmin() == 4
assert np.isnan(s.argmin(skipna=False))
assert s.argmax() == 0
assert np.isnan(s.argmax(skipna=False))
else:
if PY3:
with pytest.raises(TypeError):
s.argmin()
with pytest.raises(TypeError):
Expand All @@ -1924,3 +1919,8 @@ def test_argminmax(self):
s.argmax()
with pytest.raises(TypeError):
s.argmax(skipna=False)
else:
assert s.argmin() == 4
assert np.isnan(s.argmin(skipna=False))
assert s.argmax() == 0
assert np.isnan(s.argmax(skipna=False))

0 comments on commit 400fb56

Please sign in to comment.