title: Pandas groupby-apply: cannot reindex from a duplicate axis
body: <p>I am performing a groupby operation on a DataFrame. On each of the group I have to rename two columns and drop one, so that each group will have the following form:</p>
  
  <pre><code>index(timestamp) | column-x | column-y
  ...              |  ....    | ..... 
  </code></pre>
  
  <p>The index is a timestamp and it will be common to each group. 'column-x' and 'column-y' instead will be different to each group. My goal is then to join all groups on the index so that I have a unique DataFrame such as:</p>
  
  <pre><code>index(timestamp) | column-x1 | column-y1 | column-x2 | column-y2 | ...
  ...              |  .....    | ......    |  .......  | .......   | ...
  </code></pre>
  
  <p>The function I apply to each group is (can I make inplace edit to the group while iterating?):</p>
  
  <pre><code>def process_ssp(df_ssp):
      sensor_name = df_ssp.iloc[0]['subsystem-sensor-parameter'] # to be used as column name
      df_ssp.rename(columns = {
          'value_raw': '%s_raw' % sensor_name,
          'value_hrf': '%s_hrf' % sensor_name,
      }, inplace = True)
      df_ssp.drop('subsystem-sensor-parameter', axis='columns', inplace=True) # since this is the column I am grouping on I guess this isn't the right thing to do?
      return df_ssp
  </code></pre>
  
  <p>Then I call:</p>
  
  <pre><code>res = df_node.groupby('subsystem-sensor-parameter', as_index=False).apply(process_ssp)
  </code></pre>
  
  <p>Which produces the error:</p>
  
  <pre><code>ValueError: cannot reindex from a duplicate axis
  </code></pre>
  
  <p>EDIT:
  Dataset sample <a href="https://drive.google.com/file/d/1RvPE1t3BmjeaqCNkVqGwmokCFQQp77n8/view?usp=sharing" rel="nofollow noreferrer">https://drive.google.com/file/d/1RvPE1t3BmjeaqCNkVqGwmokCFQQp77n8/view?usp=sharing</a></p>