title: quickly drop dataframe columns with only one distinct value
body: <p>Is there a faster way to drop columns that only contain one distinct value than the code below?</p>
  
  <pre><code>cols=df.columns.tolist()
  for col in cols:
      if len(set(df[col].tolist()))&lt;2:
          df=df.drop(col, axis=1)
  </code></pre>
  
  <p>This is really quite slow for large dataframes. Logically, this counts the number of values in each column when in fact it could just stop counting after reaching 2 different values.</p>