title: How to remove all Categorical columns from a pandas DataFrame?
body: <p>Categorical columns are a great way to save memory RAM in pandas, however there are times in which they just slow down things. Specially after you are passed the stage in which you have a big dataframe and now are working in a subset. For example, it doesn't seem to play that well with printing in Jupyter or using libraries like qgrid.</p>
  <p>I basically would like to remove all categorical columns from a dataframe to speed up simple things:</p>
  <p>Here is an example:</p>
  <pre><code>df = pd.DataFrame({&quot;A&quot;: [&quot;a&quot;, &quot;b&quot;, &quot;c&quot;, &quot;a&quot;], 
                     &quot;B&quot;: [&quot;a&quot;, &quot;b&quot;, &quot;c&quot;, &quot;a&quot;],
                     &quot;C&quot;: [0,3,0,3],
                     &quot;D&quot;: [0.2,0.2,0.3,0.3],
                     &quot;F&quot;: [0,1,2,3]
                    }
                   )
  df[&quot;B&quot;] = df[&quot;B&quot;].astype('category')
  df[&quot;C&quot;] = df[&quot;C&quot;].astype('category')
  df[&quot;D&quot;] = df[&quot;D&quot;].astype('category')
  
  </code></pre>
  <p>Which results in some columns being Categorical (with different types: int, float, str).</p>
  <pre><code>df.dtypes
  A      object
  B    category
  C    category
  D    category
  F       int64
  dtype: object
  </code></pre>
  <p>Ideally something like:</p>
  <pre><code>df = df.remove_all_categorical_columns();
  </code></pre>
  <p>That would return the original basic types:</p>
  <pre><code>df.dtypes
  A     object
  B     object
  C      int64
  D    float64
  F      int64
  dtype: object
  </code></pre>