Computer Science, asked by shivansht2005, 1 month ago

Write a Python Program to rename index values in Python.​

Answers

Answered by gouravgupta65
3

Answer:

Example #1: Use Series.rename() function to rename the name of the given Series object.

# importing pandas as pd

import pandas as pd

# Creating the Series

sr = pd.Series([10, 25, 3, 11, 24, 6])

# Create the Index

index_ = ['Coca Cola', 'Sprite', 'Coke', 'Fanta', 'Dew', 'ThumbsUp']

# set the index

sr.index = index_

# Print the series

print(sr)

Answered by BrainlyBska
1

Answer:

Refer to above attachment

Explanation:

Refer to above attachment

Attachments:
Similar questions