title: Reverse the Multi label binarizer in pandas
body: <p>I have pandas dataframe as </p>
  
  <pre><code>import pandas as pd
  from sklearn.preprocessing import MultiLabelBinarizer
  mlb = MultiLabelBinarizer()
  
  # load sample data 
  df = pd.DataFrame( {'user_id':['1','1','2','2','2','3'], 'fruits':['banana','orange','orange','apple','banana','mango']})
  </code></pre>
  
  <p>I collect all the fruits for each user using below code - </p>
  
  <pre><code># collect fruits for each user 
  transformed_df= df.groupby('user_id').agg({'fruits':lambda x: list(x)}).reset_index()
  
  print(transformed_df)
    user_id                   fruits
  0       1         [banana, orange]
  1       2  [orange, apple, banana]
  2       3                  [mango]
  </code></pre>
  
  <p>Once I get this list, I do multilabel-binarizer operation to convert this list into ones or zeroes</p>
  
  <pre><code># perform MultiLabelBinarizer
  final_df = transformed_df.join(pd.DataFrame(mlb.fit_transform(transformed_df.pop('fruits')),columns=mlb.classes_,index=transformed_df.index))
  
  print(final_df)
    user_id  apple  banana  mango  orange
  0       1      0       1      0       1
  1       2      1       1      0       1
  2       3      0       0      1       0
  </code></pre>
  
  <p>Now, I have a requirement wherein, the input dataframe given to me is <code>final_df</code> and I need to get back the <code>transformed_df</code> which contains the list of <code>fruits</code> for each user.</p>
  
  <p>How can I get this <code>transformed_df</code> back , given that I have <code>final_df</code> as input dataframe?</p>
  
  <p>I am trying to get this working </p>
  
  <pre><code># Trying to get this working
  inverse_df = final_df.join(pd.DataFrame(mlb.inverse_transform(final_df.loc[:, final_df.columns != 'user_id'].as_matrix())))
  
  inverse_df
    user_id  apple  banana  mango  orange       0       1       2
  0       1      0       1      0       1  banana  orange    None
  1       2      1       1      0       1   apple  banana  orange
  2       3      0       0      1       0   mango    None    None
  </code></pre>
  
  <p>But it doesnt give me the list back.</p>