title: Group duplicate column IDs in pandas dataframe
body: <p>Now there are a lot of similar questions but most of them answer how to delete the duplicate columns. However, I want to know how can I make a list of tuples where each tuple contains the column names of duplicate columns. I am assuming that each column has a unique name. Just to further illustrate my question:</p>
  
  <pre><code>df = pd.DataFrame({'A': [1, 2, 3, 4, 5],'B': [2, 4, 2, 1, 9],
                     'C': [1, 2, 3, 4, 5],'D': [2, 4, 2, 1, 9],
                     'E': [3, 4, 2, 1, 2],'F': [1, 1, 1, 1, 1]},
                     index = ['a1', 'a2', 'a3', 'a4', 'a5'])
  </code></pre>
  
  <p>then I want the output:</p>
  
  <pre><code>[('A', 'C'), ('B', 'D')]
  </code></pre>
  
  <p>And if you are feeling great today then also extend the same question to rows. How to get a list of tuples where each tuple contains duplicate rows.</p>