From 07f3d432fc0a5bd3b3ede7ca29ba82d41d38353c Mon Sep 17 00:00:00 2001 From: AG <98327736+ggold7046@users.noreply.github.com> Date: Wed, 19 Apr 2023 19:07:54 +0530 Subject: [PATCH] Update series.py DOC add example of Series.index #51842 . A newline between the text and the code is missing. --- pandas/core/series.py | 1 + 1 file changed, 1 insertion(+) diff --git a/pandas/core/series.py b/pandas/core/series.py index 8d7354f5f4f0c..81cf839ad5f1c 100644 --- a/pandas/core/series.py +++ b/pandas/core/series.py @@ -5522,6 +5522,7 @@ def to_period(self, freq: str | None = None, copy: bool | None = None) -> Series Index(['Kolkata', 'Chicago', 'Toronto', 'Lisbon'], dtype='object') To change the index labels of an existing Series: + >>> city_series.index = ['KOL', 'CHI', 'TOR', 'LIS'] >>> city_series.index Index(['KOL', 'CHI', 'TOR', 'LIS'], dtype='object')