How to rename column in pandas?

0 votes
I want to rename a column in pandas dataframe. How can I do that?
Apr 3 in Python by Dinesh
16 views

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
0 votes

You can use the rename option to do this. Refer to the below command:

data = pd.read_csv("example.csv", index_col ="Name" )
data.rename(index = {"Column 1": "New Column name"}, inplace = True)
answered Apr 3 by Firoz

Related Questions In Python

0 votes
1 answer

How to print just one column in pandas?

You can use the header to print ...READ MORE

answered Apr 3 in Python by TIna
8 views
0 votes
1 answer

How to replace entire column in pandas dataframe?

Use the dataframe with respective column names ...READ MORE

answered May 8 in Python by John
7 views
0 votes
1 answer

How to select a single column in Pandas?

Pandas allows you to index the dataframe ...READ MORE

answered May 9 in Python by Suman
8 views
0 votes
1 answer

How to replace values with None in Pandas data frame in Python?

Actually in later versions of pandas this ...READ MORE

answered Aug 30, 2018 in Python by Priyaj
• 56,120 points
289 views
0 votes
1 answer

How to parse html file to BeautifulSoup?

Hey. Refer to the following code: driver.get("link") html = ...READ MORE

answered Apr 2 in Python by Kirti
12 views
0 votes
1 answer

How to find an element in Pandas Dataframe?

You can do it like this: Suppose df is ...READ MORE

answered Apr 8 in Python by Tina
16 views
0 votes
1 answer

How to find if setuptools is installed in python?

You can use python interpreter to check ...READ MORE

answered Jan 29 in Python by Omkar
• 65,850 points
12 views

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.