python split only last occurrence of a character
s.rsplit(',', 1)
s.rpartition(',')
python split only last occurrence of a character
s.rsplit(',', 1)
s.rpartition(',')
Get last “column” after .str.split() operation on column in pandas DataFrame
>>> temp = pd.DataFrame({'ticker' : ['spx 5/25/2001 p500', 'spx 5/25/2001 p600', 'spx 5/25/2001 p700']})
>>> temp['ticker'].str.split(' ').str[-1]
0 p500
1 p600
2 p700
Name: ticker, dtype: object
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us