From c6f651b17169679be8de675ff099ab8b29183d99 Mon Sep 17 00:00:00 2001 From: avelineg <50472542+avelineg@users.noreply.github.com> Date: Fri, 9 Aug 2019 11:24:29 +0800 Subject: [PATCH 1/2] Add example for Series.str.slice() Add example to show that negative values for start are allowed for Series.str.slice(). --- pandas/core/strings.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pandas/core/strings.py b/pandas/core/strings.py index 169a3a24c254d..9d0c20432891b 100644 --- a/pandas/core/strings.py +++ b/pandas/core/strings.py @@ -1442,6 +1442,12 @@ def str_slice(arr, start=None, stop=None, step=None): 2 hameleon dtype: object + >>> s.str.slice(start=-1) + 0 a + 1 x + 2 n + dtype: object + >>> s.str.slice(stop=2) 0 ko 1 fo From 3c27a50b74d2e5deb8cbeec1609913a9a7b08a9b Mon Sep 17 00:00:00 2001 From: avelineg <50472542+avelineg@users.noreply.github.com> Date: Fri, 9 Aug 2019 11:34:31 +0800 Subject: [PATCH 2/2] Add example for Series.str.slice() Add example to show that negative values for start are allowed for Series.str.slice(). --- pandas/core/strings.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pandas/core/strings.py b/pandas/core/strings.py index 9d0c20432891b..25350119f9df5 100644 --- a/pandas/core/strings.py +++ b/pandas/core/strings.py @@ -1442,11 +1442,11 @@ def str_slice(arr, start=None, stop=None, step=None): 2 hameleon dtype: object - >>> s.str.slice(start=-1) - 0 a - 1 x - 2 n - dtype: object + >>> s.str.slice(start=-1) + 0 a + 1 x + 2 n + dtype: object >>> s.str.slice(stop=2) 0 ko