@@ -5486,7 +5486,46 @@ def to_period(self, freq: str | None = None, copy: bool | None = None) -> Series
5486
5486
_info_axis_name : Literal ["index" ] = "index"
5487
5487
5488
5488
index = properties .AxisProperty (
5489
- axis = 0 , doc = "The index (axis labels) of the Series."
5489
+ axis = 0 ,
5490
+ doc = """
5491
+ The index (axis labels) of the Series.
5492
+
5493
+ The index of a Series is used to label and identify each element of the
5494
+ underlying data. The index can be thought of as an immutable ordered set
5495
+ (technically a multi-set, as it may contain duplicate labels), and is
5496
+ used to index and align data in pandas.
5497
+
5498
+ Returns
5499
+ -------
5500
+ Index
5501
+ The index labels of the Series.
5502
+
5503
+ See Also
5504
+ --------
5505
+ Series.reindex : Conform Series to new index.
5506
+ Series.set_index : Set Series as DataFrame index.
5507
+ Index : The base pandas index type.
5508
+
5509
+ Notes
5510
+ -----
5511
+ For more information on pandas indexing, see the `indexing user guide
5512
+ <https://pandas.pydata.org/docs/user_guide/indexing.html>`__.
5513
+
5514
+ Examples
5515
+ --------
5516
+ To create a Series with a custom index and view the index labels:
5517
+
5518
+ >>> cities = ['Kolkata', 'Chicago', 'Toronto', 'Lisbon']
5519
+ >>> populations = [14.85, 2.71, 2.93, 0.51]
5520
+ >>> city_series = pd.Series(populations, index=cities)
5521
+ >>> city_series.index
5522
+ Index(['Kolkata', 'Chicago', 'Toronto', 'Lisbon'], dtype='object')
5523
+
5524
+ To change the index labels of an existing Series:
5525
+ >>> city_series.index = ['KOL', 'CHI', 'TOR', 'LIS']
5526
+ >>> city_series.index
5527
+ Index(['KOL', 'CHI', 'TOR', 'LIS'], dtype='object')
5528
+ """ ,
5490
5529
)
5491
5530
5492
5531
# ----------------------------------------------------------------------
0 commit comments