Python Pandas get_dummies() limitation. Doesnt convert all columns
<p>I have 6 columns in my dataframe. 2 of them have about 3K unique values. When I use <code>get_dummies()</code> on the entire dataframe or just one those 2 columns what gets returned is the exact same column with 3k values. <code>get_dummies</code> fails to dummy-fy the bigger columns. 
Some columns do get one-hot encoded but the big ones dont. </p>

<p>I wonder if get_dummies only works on sets with small cardinality. </p>

<p>I believe this was also discusses here:  <a href="http://stackoverflow.com/questions/25057694/need-help-with-pythonpandas-script#comment66274933_25057694">Need help with python(pandas) script</a></p>

<p>It appears to work as intended for me.</p>

<p>Consider the series <code>s</code> of random 3 character strings</p>

<pre><code>import pandas as pd
import numpy as np
from string import lowercase

np.random.seed([3,1415])
s = pd.DataFrame(np.random.choice(list(lowercase), (10000, 3))).sum(1)

s.nunique()

7583
</code></pre>

<p>Then assign the dataframe <code>df</code></p>

<pre><code>df = s.str.get_dummies()
</code></pre>

<hr>

<pre><code>df.shape

(10000, 7583)
</code></pre>

<hr>

<pre><code>df.sum(1).describe()

count    10000.0
mean         1.0
std          0.0
min          1.0
25%          1.0
50%          1.0
75%          1.0
max          1.0
dtype: float64
</code></pre>

python pandas one-hot-encoding