Skip to content

Commit 400fb56

Browse files
author
Daniel Grady
committed
Re-word whatsnew entry; use compat.PY3
1 parent 9999269 commit 400fb56

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

doc/source/whatsnew/v0.21.0.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ Sparse
127127
Reshaping
128128
^^^^^^^^^
129129

130-
- `{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.
130+
- `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.
131131

132132
Numeric
133133
^^^^^^^

pandas/tests/series/test_operators.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
from pandas.core.indexes.timedeltas import Timedelta
2222
import pandas.core.nanops as nanops
2323

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

1913-
if sys.version_info[0] < 3:
1914-
assert s.argmin() == 4
1915-
assert np.isnan(s.argmin(skipna=False))
1916-
assert s.argmax() == 0
1917-
assert np.isnan(s.argmax(skipna=False))
1918-
else:
1913+
if PY3:
19191914
with pytest.raises(TypeError):
19201915
s.argmin()
19211916
with pytest.raises(TypeError):
@@ -1924,3 +1919,8 @@ def test_argminmax(self):
19241919
s.argmax()
19251920
with pytest.raises(TypeError):
19261921
s.argmax(skipna=False)
1922+
else:
1923+
assert s.argmin() == 4
1924+
assert np.isnan(s.argmin(skipna=False))
1925+
assert s.argmax() == 0
1926+
assert np.isnan(s.argmax(skipna=False))

0 commit comments

Comments
 (0)