title: Dataframe:Create new dataframe keeping duplicate on basis of multiple columns which are coming more then 2 times(Time constraint)
body: <p><strong>This ia sample code:</strong></p>
  <pre><code>data = {'Col1':  [0,1,2,3,4,5,6,7,8,9,10,11,12],
              'Col2': ['A1','A1','A1','A2','A2','A3','A4','A4','A4','A1','a9','a9','A2'],
              'Col3': ['B1','B1','B1','B2','B3','B4','B5','B5','B5','B1','b9','b9','B2'],
              'Col4': ['ab','bc','cd','da','da','da','df','fd','vf','sd','asd','sda','sdf'],
              }
  
      df2 = pd.DataFrame (data)
  
      counts_col2 = df2.groupby(&quot;Col2&quot;)[&quot;Col2&quot;].transform(len)
      counts_col3 = df2.groupby(&quot;Col3&quot;)[&quot;Col3&quot;].transform(len)
      
      mask = (counts_col2 &gt; 2) &amp; (counts_col3 &gt; 2)
  
      df2[mask]
  </code></pre>
  <p><strong>output</strong></p>
  <pre><code>    Col1 Col2 Col3 Col4
  0   0     A1    B1  ab
  1   1     A1    B1  bc
  2   2     A1    B1  cd
  6   6     A4    B5  df
  7   7     A4    B5  fd
  8   8     A4    B5  vf
  9   9     A1    B1  sd
  </code></pre>
  <ol>
  <li>Everything is right in it,But Since my data is huge
  is taking long time to execute.</li>
  <li>So if any  better soultion can be used  for reducing time</li>
  <li><strong>Any help would be apreciated</strong></li>
  </ol>