Skip to content

Commit bba2efc

Browse files
committed
Update whatsnew entry; fix tests
1 parent f117029 commit bba2efc

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

doc/source/whatsnew/v0.19.0.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,7 @@ API changes
332332
- ``PeriodIndex.fillna`` with ``Period`` has different freq now coerces to ``object`` dtype (:issue:`13664`)
333333
- More informative exceptions are passed through the csv parser. The exception type would now be the original exception type instead of ``CParserError``. (:issue:`13652`)
334334
- ``astype()`` will now accept a dict of column name to data types mapping as the ``dtype`` argument. (:issue:`12086`)
335+
- `Series.sort_index`` will now accept kwargs ``kind`` and ``na_position`` (:issue:`13589`)
335336

336337

337338
.. _whatsnew_0190.api.tolist:
@@ -731,5 +732,3 @@ Bug Fixes
731732
- Bug where ``pd.read_gbq()`` could throw ``ImportError: No module named discovery`` as a result of a naming conflict with another python package called apiclient (:issue:`13454`)
732733
- Bug in ``Index.union`` returns an incorrect result with a named empty index (:issue:`13432`)
733734
- Bugs in ``Index.difference`` and ``DataFrame.join`` raise in Python3 when using mixed-integer indexes (:issue:`13432`, :issue:`12814`)
734-
735-
- Bug in ``Series.sort_index`` didn't accept kwargs ``kind`` and ``na_position`` (:issue:`13589`)

pandas/tests/series/test_sorting.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -151,11 +151,11 @@ def test_sort_index_nan(self):
151151
ser = Series(['A', np.nan, 'C', 'D'], [1, 2, 0, np.nan])
152152

153153
# na_position='last', kind='quicksort'
154-
sorted_series = ser.sort_index(kind='quicksort', na_position='last')
155-
expected_series = Series(['C', 'A', np.nan, 'D'], [0, 1, 2, np.nan])
156-
assert_series_equal(sorted_series, expected_series)
154+
result = ser.sort_index(kind='quicksort', na_position='last')
155+
expected = Series(['C', 'A', np.nan, 'D'], [0, 1, 2, np.nan])
156+
assert_series_equal(result, expected)
157157

158158
# na_position='first'
159-
sorted = ser.sort_index(na_position='first')
159+
result = ser.sort_index(na_position='first')
160160
expected = Series(['D', 'C', 'A', np.nan], [np.nan, 0, 1, 2])
161-
assert_series_equal(sorted, expected)
161+
assert_series_equal(result, expected)

0 commit comments

Comments
 (0)