Get last column after .str.split() operation on column in pandas DataFrame code example
Example: 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