title: Is grouping in dataframe based on specific parameters possible using Python?
body: <p>When you have a large data set in excel (xlsx, csv, or xls) and have certain repeating values that you have to select for, how do you do it? That's like a very vague and broad way of stating it so...</p>
  
  <p>Take this example:</p>
  
  <p>DataFrame1: </p>
  
  <pre><code>**Name**    **No.**      **Comment**       
  Bob        2123320     Doesn't Matter   
  Joe        2832883     Whatever           
  John       2139300     Irrelevant        
  Bob        2123320     Something          
  John       2234903     Regardless
  </code></pre>
  
  <p>DataFrame2:</p>
  
  <pre><code>**Name**    **No.**      **Report**       
  Bob        2123320         Great 
  Joe        2832883         Solid           
  John       2139300        Awesome        
  Bob        2123320         Good          
  John       2234903        Perfect
  </code></pre>
  
  <p>I am basically looking for a way to only select No.'s that have appeared twice for one name and then list them out like this:</p>
  
  <pre><code>**Name**         **2139300**   **2139300**   **2234903**  **2234903**
   John            Irrelevant      Awesome      Regardless    Perfect
  </code></pre>
  
  <p>So basically it looks for each name, and then for each name it looks to see how many distinct No.'s it has, and for each distinct No.'s, it searches for what the "Comment" and "Report" is and then ouputs an excel sheet like above. Although Bob appeared twice, since both times he had the same No., it doesn't count and John is the only relevant person. </p>
  
  <p>Is there a way to do this once imported into a dataframe using Pandas, like perhaps by using a dictionary that counts each No. for each name and then merging the dataframes?</p>
  
  <p>Thank you so much</p>