title: Pandas - Duplicate Row based on condition
body: <p>I'm trying to create a duplicate row if the row meets a condition. In the table below, I created a cumulative count based on a groupby, then another calculation for the MAX of the groupby.</p>
  
  <pre><code>df['PathID'] = df.groupby(DateCompleted).cumcount() + 1
  df['MaxPathID'] = df.groupby(DateCompleted)['PathID'].transform(max)
  
  Date Completed    PathID    MaxPathID
  1/31/17           1         3
  1/31/17           2         3
  1/31/17           3         3
  2/1/17            1         1
  2/2/17            1         2
  2/2/17            2         2
  </code></pre>
  
  <p>In this case, I want to duplicate only the record for 2/1/17 since there is only one instance for that date (i.e. where the MaxPathID == 1).</p>
  
  <p>Desired Output:</p>
  
  <pre><code>Date Completed    PathID    MaxPathID
  1/31/17           1         3
  1/31/17           2         3
  1/31/17           3         3
  2/1/17            1         1
  2/1/17            1         1
  2/2/17            1         2
  2/2/17            2         2
  </code></pre>
  
  <p>Thanks in advance!</p>