title: Pandas dataframe to doc2vec.LabeledSentence
body: <p>I have this dataframe :</p>
  
  <pre><code>    order_id    product_id  user_id          
      2           33120       u202279  
      2           28985       u202279  
      2           9327        u202279  
      4           39758       u178520  
      4           21351       u178520  
      5           6348        u156122  
      5           40878       u156122  
  </code></pre>
  
  <p>Type user_id : String<br>
  Type product_id : Integer  </p>
  
  <p>I would like to use this dataframe to create a Doc2vec corpus. So, I need to use the LabeledSentence function to create a dict :<br>
   {tags : user_id, words:
  all product ids ordered by each user_id}   </p>
  
  <p>But the the dataframe shape is (32434489, 3), so I should avoid to use a loop to create my labeledSentence. </p>
  
  <p>I try to run this function (below) with multiprocessing but is too long.  </p>
  
  <p>Have you any idea to transform my dataframe in the good format for a Doc2vec corpus where the tag is the user_id and the words is the list of products by user_id?</p>
  
  <pre><code>def append_to_sequences(i):
       user_id = liste_user_id.pop(0)
       liste_produit_userID = data.ix[data["user_id"]==user_id, "product_id"].astype(str).tolist()
       return doc2vec.LabeledSentence(words=prd_user_list, tags=user_id )
  
  pool = multiprocessing.Pool(processes=3)
  result = pool.map_async(append_to_sequences, np.arange(len_liste_unique_user))
  pool.close()
  pool.join()
  sentences = result.get()
  </code></pre>