title: Check which columns in DataFrame are Categorical
body: <p>I am new to Pandas... I want to a simple and generic way to find which columns are <code>categorical</code> in my <code>DataFrame</code>, when I don't manually specify each column type, unlike in <a href="https://stackoverflow.com/questions/26924904/check-if-dataframe-column-is-categorical">this SO question</a>. The <code>df</code> is created with:</p>
  
  <pre><code>import pandas as pd
  df = pd.read_csv("test.csv", header=None)
  </code></pre>
  
  <p>e.g.</p>
  
  <pre><code>           0         1         2         3        4
  0   1.539240  0.423437 -0.687014   Chicago   Safari
  1   0.815336  0.913623  1.800160    Boston   Safari
  2   0.821214 -0.824839  0.483724  New York   Safari
  </code></pre>
  
  <p>.</p>
  
  <p><strong>UPDATE (2018/02/04) The question assumes numerical columns are NOT categorical, @Zero's <a href="https://stackoverflow.com/a/29803290/1910555">accepted answer solves this</a>.</strong></p>
  
  <p><strong>BE CAREFUL - As @Sagarkar's comment points out that's not always true.</strong> The difficulty is that Data Types and Categorical/Ordinal/Nominal types are orthogonal concepts, thus mapping between them isn't straightforward. @Jeff's <a href="https://stackoverflow.com/a/29821799/1910555">answer</a> below specifies the precise manner to achieve the manual mapping.</p>