Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #create Name_model features from Name feature
- train['Name_model'] = train.Name.str.split().str[0:2]
- #The result of line 1 produces a list, we'll join the two values in the list
- train['Name_model'] = train.Name_model.apply(lambda x: ' '.join(x))
- #Create name_gen feature
- train['Name_gen'] = train.Name.str.split().str[0]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement