title: Pandas Comparing aggregates with original columns
body: <p>I'm having difficulty comparing a pandas dataframe with aggregate columns generated from that dataframe. Concretely if I have</p>
  
  <pre><code>df = Col1 Col2
       a    p
       a    q
       a    r
       b    r
       c    s
  </code></pre>
  
  <p>I'd like a boolean dataframe that is true where each entry is equal to the modal value for that column. I've tried</p>
  
  <pre><code>df == df.mode()
  </code></pre>
  
  <p>but that gives me <code>Can only compare identically labelled DataFrame objects</code>. I'd like something that can broadcast the second dataframe across the rows of the first dataframe to calculate the result. To be clear, in the above case I have</p>
  
  <pre><code>modal_df = df.mode()
  modal_df = Col1 Col2
             a    r
  
  desired_result = Col1  Col2
                   True  False
                   True  False
                   True  True
                   False True
                   False False
  </code></pre>