pd series rename

Solutions on MaxInterview for pd series rename by the best coders in the world

showing results for - "pd series rename"
Avia
14 Jan 2021
1>>> s = pd.Series([1, 2, 3])
2>>> s
30    1
41    2
52    3
6dtype: int64
7>>> s.rename("my_name")  # scalar, changes Series.name
80    1
91    2
102    3
11Name: my_name, dtype: int64
12>>> s.rename(lambda x: x ** 2)  # function, changes labels
130    1
141    2
154    3
16dtype: int64
17>>> s.rename({1: 3, 2: 5})  # mapping, changes labels
180    1
193    2
205    3
21dtype: int64
22
queries leading to this page
pandas columns renamepandas column rename rename axis series pandaspandas name a seriespandas series renamerename dataframe seriesrename 28axis 3d1 29 function pandasrename of pandas series namerename column series pandasrename name of series pandaspandas time series rename columnrename series pandashow to rename series in pandaspd series renamehow to label serries in panda rename in pandaspandas series rename index valuesdf columns renamepandas series column namehow to rename a series without affecting dataframerename series item pandaspandas rename seriespd series renamecolumn rename pandaspandas rename series namehow to rename a pandas seriesrename df serieshow to rename series in dataframepandas renamerelabel pandas series indexpandas series rename keysrename series in pandasdf columns renamerename dataframe pandasseries add name pandaspython series renamerename series pythonrename series columnpython dataframe renameseries rename columndf rename pandasseries rename rename series pandaspandas change series namerename pandas seriespandas rename series columnpandas series rename columnreaname seriesdf renamepandas series change headerchange index name pandas seriesrename a pandas seriespython rename pandas columnpandas rename column in seriescolumn rename in pandaspython rename seriespandas rename axishow to name a series oandasdataframe renamepandas renamepandas series given column namerename of pandas series renamein pandaspandas series rename axisdf rename 28 29rename columns based on seriespandas serise change namepandas name series columnhow to the change the name of the pandas seriesrename a series pandaspandas dataframe renamepandas rename according to seriespandas series rename indexhow to name pandas seriespandas set name of seriesrename series column pandasseries renamecolumn name in pandas seriespandas column rename changerename pandasrename column in series pythonrename keys of seriesnaming a series pandaspandas rename dataframe according to serieshow to rename a series in pandaspandas name seriespd renamerename series columnpandaspandas series renamepandas renamepd series rename