擅长:python、mysql、java
<p>可以使用<code>df._get_numeric_data()</code>获取数值列,然后查找分类列</p>
<pre><code>In [66]: cols = df.columns
In [67]: num_cols = df._get_numeric_data().columns
In [68]: num_cols
Out[68]: Index([u'0', u'1', u'2'], dtype='object')
In [69]: list(set(cols) - set(num_cols))
Out[69]: ['3', '4']
</code></pre>