title: How to rename columns using the dictionary?
body: <p>I have several pandas DataFrame's and I want to align their column names, so that all of them have the same names of particular columns (not all columns).</p>
  
  <p>In my real data sets I have many columns, but below I provide a simplified example of 3 DataFrames. All of them have the same content, but it is done to simplify the example.</p>
  
  <pre><code>df1 =
  
  col1   col2    col3
  111    123     abc
  122    331     zzz
  
  df2 =
  
  colA   colB    col3
  111    123     abc
  122    331     zzz
  
  df3 =
  
  col_1   col_2    col3
  111     123      abc
  122     331      zzz
  </code></pre>
  
  <p>Then I have the following dictionary that specifies similar columns (in reality the dictionary is bigger):</p>
  
  <pre><code>col_names = {
    "col1": ["colA", "col_1"],
    "col2": ["colB", "col_2"]
  }
  </code></pre>
  
  <p>It means that the columns <code>colA</code> and <code>col_1</code> should be renamed as <code>col1</code>, and the columns <code>colB</code> and <code>col_2</code> should be renamed to <code>col2</code>.</p>
  
  <p>I know how to rename columns one by one in pandas DataFrame:</p>
  
  <pre><code>df.rename(columns={"colA": "col1"}, inplace=True)
  </code></pre>
  
  <p>However, I am confused how to use the dictionary to rename columns flexibly?</p>