title: Get rows that have the same value across its columns in pandas
body: <p>In pandas, given a DataFrame D:</p>
  
  <pre><code>+-----+--------+--------+--------+   
  |     |    1   |    2   |    3   |
  +-----+--------+--------+--------+
  |  0  | apple  | banana | banana |
  |  1  | orange | orange | orange |
  |  2  | banana | apple  | orange |
  |  3  | NaN    | NaN    | NaN    |
  |  4  | apple  | apple  | apple  |
  +-----+--------+--------+--------+
  </code></pre>
  
  <p>How do I return rows that have the same contents across all of its columns when there are three columns or more such that it returns this:</p>
  
  <pre><code>+-----+--------+--------+--------+   
  |     |    1   |    2   |    3   |
  +-----+--------+--------+--------+
  |  1  | orange | orange | orange |
  |  4  | apple  | apple  | apple  |
  +-----+--------+--------+--------+
  </code></pre>
  
  <p>Note that it skips rows when all values are NaN.</p>
  
  <p>If this were only two columns, I usually do <code>D[D[1]==D[2]]</code> but I don't know how to generalize this for more than 2 column DataFrames. </p>