title: Pandas: Get all columns that have constant value
body: <p>I want to get the names of the columns which have same values across all rows for each column.</p>
  
  <p>My data:</p>
  
  <pre><code>   A   B  C  D
  0  1  hi  2  a
  1  3  hi  2  b
  2  4  hi  2  c
  </code></pre>
  
  <p>Desired output:</p>
  
  <pre><code>['B', 'C']
  </code></pre>
  
  <p>Code:</p>
  
  <pre><code>import pandas as pd
  
  d = {'A': [1,3,4], 'B': ['hi','hi','hi'], 'C': [2,2,2], 'D': ['a','b','c']}
  df = pd.DataFrame(data=d)
  </code></pre>
  
  <p>I've been playing around with <code>df.columns</code> and <code>.any()</code>, but can't figure out how to do this.</p>