2017-07-19 40 views

回答

0

嘗試testdf['domain'] = '@' + testdf.Email.str.partition('@')[2]

0

使用.str.split

testdf.Email.str.split('@').str[1] 

輸出:

0 hotmail.com 
1  gmail.com 
2  aol.com 
Name: Email, dtype: object 

以 '@':

'@' + testdf.Email.str.split('@').str[1] 

輸出:

0 @hotmail.com 
1  @gmail.com 
2  @aol.com 
Name: Email, dtype: object