Skip to content
  • View menu
  • View sidebar

bioinfo core

Index & solution of bioInfo utilities

  • Home
  • All entries
  • Blogs
  • Contact
  • About

Categories

  • Between languages (7)
  • Blogs (8)
  • Python (35)
  • R (1)
  • Unix (37)

Tags

bedfile Blogs conda Excel html numpy Pandas Python R slurm Unix
04/28/202010/21/2021 by bioinfocore

Pandas rename one column or one index

  • Python
  • Pandas, Python

Rename only one or a few pandas dataframe columns:

df.rename(columns={"A": "a", "B": "c"}, inplace=True)

Rename one or a few index:

df.rename(index={"A": "a", "B": "c"}, inplace=True)

Source:
https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.rename.html

Post navigation

← Previous Post Unix store a list of files into an array variable
Next Post → Unix regex grep extract substring
Copyright 2022 | by bioinfocore