example 1 : 

```
a = [['w1' , 'w3'] , ['w2' , 'w4']]

df=pd.DataFrame({'a': a })
print(df)

mlb = MultiLabelBinarizer()
print(np.array(mlb.fit_transform(df['a'].as_matrix())))

```

renders : 

```
          a
0  [w1, w3]
1  [w2, w4]
[[1 0 1 0]
 [0 1 0 1]]

```

---

example 2 : 

```
a = ['w1 w2' , 'w1 w3']

df=pd.DataFrame({'a': a })
print(df)

mlb = MultiLabelBinarizer()
print(np.array(mlb.fit_transform(df['a'].as_matrix())))

```

renders : 

```
   a
0  w1 w2
1  w1 w3
[[1 1 1 0 1]
 [1 1 0 1 1]]

```

example 1 appears to one hot encode the dataframe at word level. What is example 2 computing ? It also appears to be one hot encoding but is not at word level ? I initially thought it was at character level but dataframe contains characters `1,2,3,w` , 4 characters but each array element : 

```
[[1 1 1 0 1]
 [1 1 0 1 1]]

```

Is 5 characters in length.

Above code utilizes `MultiLabelBinarizer` <http://scikit-learn.org/stable/modules/generated/sklearn.preprocessing.MultiLabelBinarizer.html>