<How to get first name and last name when last nam...
# community-feeds
r
How to get first name and last name when last name is multiple names in pandas I have a data frame and need to separate first and last name. So far this is where I got to. df = [['Victor De La Cruz', 'Ashley Smith', 'Angel Miguel Hernandez', 'Hank Hill']] df['first_name'] = df.str.split().str[0] df['last_name'] = df.str.split().str[1:] OutPut first_name last_name Victor [De, La, Cruz] Ashley [Smith] Angel [Miguel, Hernandez] Hank [Hill] I have tried using df'last_name'].replace('[', '')for all characters not...