devsheet logo Devsheet
My Feed Posts
Tools
JSON Viewer Javascript Runner Comma Converter HTML Editor SCSS to CSS SQL Formatter Online
Pandas Basics
  • Install Pandas using pip Python
  • Create DataFrame and add columns and rows
  • Loop through pandas DataFrame rows
  • Get a value from DataFrame row using index and column in pandas
  • Get column names from Pandas DataFrame
  • Rename columns names in a pandas dataframe
  • Delete one or multiple columns from Dataframe
  • Add a new column to Dataframe
  • Create DataFrame from Python List
  • Sort a DataFrame by rows and columns in Pandas
  • Merge two or multiple DataFrames in pandas
  • Convert a Python Dictionary to Pandas DataFrame
  • Get index values of a DataFrame as a List
  • Select specific columns from a Pandas DataFrame
  • DataFrame.where() function in Pandas
Pandas Examples
  • Reorder dataframe columns using column names in pandas
  • DataFrame to List of dictionaries
  • Dictionary to DataFrame Pandas
  • Convert pandas DataFrame to python collection - dictionary
  • Pandas - Remove duplicate items from list
  • Get a column rows as a List in Pandas Dataframe
  • Replace NAN values in Pandas dataframe
  • Insert new column with default value in DataFrame
  • Pandas dataframe to dictionary
  • Get the count of rows and columns of a DataFrame
  • Add new column to DataFrame based on existing column
  • Check if a column exists in a DataFrame
  • Check if a column contains only zero values in DataFrame
  • Change column orders using column names list
  • Pandas - Change rows order of a DataFrame using index list
  • Delete multiple rows from DataFrame using index list
  • Remove duplicate rows from DataFrame
  • Get column values as list
  • Replace column values with a specific value
  • Change column values condition based
  • Add new row to an existing DataFrame
  • Count NaN values in a DataFrame
  • Add suffix/prefix to column names of DataFrame
  • Get all rows that contain a substring in Pandas DataFrame
  • Print DataFrame in pretty format in Terminal
  • Counting rows in a Pandas Dataframe based on column values
  • Delete the first column in a Pandas DataFrame
python

rename columns

report_old.rename(columns={
    _col: _col+'_old' for _col in report_old.columns if _col not in ['item_id', ]
}, inplace=True)
Was this helpful?
Similar Posts
  • Reorder dataframe columns using column names in pandas
  • Create pandas DataFrame and add columns and rows to it
  • Change the name of columns in a pandas dataframe
  • Delete one or multiple columns from Pandas Dataframe
  • Get the count of rows and columns of a Pandas DataFrame
  • Sort a DataFrame by rows and columns in Pandas
  • Select specific columns from a Pandas DataFrame
Search all posts...
Programmer's Homepage
Your One-Stop Chrome Extension for Curated Developer Feeds, Where Learning and Growth Never Stop!
Connect using Github
  • Sign up
  • Login
Generating new answer. Please wait...