How to rename column in pandas?

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

1 answer to this question.

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, 2019 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, 2019 in Python by TIna
864 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, 2019 in Python by John
4,568 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, 2019 in Python by Suman
127 views
0 votes
1 answer

How to rename columns in pandas?

Hi,  To rename columns in pandas, you can ...READ MORE

answered Aug 9, 2019 in Python by Taj
• 1,080 points
119 views
0 votes
1 answer
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, 2019 in Python by Kirti
672 views
0 votes
1 answer
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, 2019 in Python by Tina
11,143 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, 2019 in Python by Omkar
• 69,030 points
182 views