SHARE
TWEET

Untitled

a guest Aug 23rd, 2019 55 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #create Name_model features from  Name feature
  2. train['Name_model'] = train.Name.str.split().str[0:2]
  3.  
  4. #The result of line 1 produces a list, we'll join the two values in the list
  5. train['Name_model'] = train.Name_model.apply(lambda x: ' '.join(x))
  6. #Create name_gen feature
  7. train['Name_gen'] = train.Name.str.split().str[0]
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top