Skip to content
Prev Previous commit
Next Next commit
BUG: series.truncate fix for one-element series (#35544) - PR review …
…updates
  • Loading branch information
gabicca committed Aug 5, 2020
commit 2e85aef7caa2db9647109b9e7c1744fda3ad5232
2 changes: 1 addition & 1 deletion doc/source/whatsnew/v1.1.1.rst
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ Categorical

**Indexing**

- Bug in series.truncate when trying to truncate a single-element series (:issue:`35544`)
- Bug in :meth:`Series.truncate` when trying to truncate a single-element series (:issue:`35544`)

.. ---------------------------------------------------------------------------

Expand Down
5 changes: 4 additions & 1 deletion pandas/tests/series/methods/test_truncate.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,4 +148,7 @@ def test_truncate_one_element_series(self):
before = pd.Timestamp("2020-08-02")
after = pd.Timestamp("2020-08-04")

assert series.truncate(before=before, after=after).equals(series)
result = series.truncate(before=before, after=after)

# the input Series and the expected Series are the same
tm.assert_series_equal(result, series)