I have a data frame df with column ID in the following pattern. What I want is to return a string column with the number after the dash sign. For the example below, I need 01,01,02. I used the command below and it failed. Since it is a very large data frame, I think it might be inefficient to do a loop and row by row extraction. Please advise, thanks
df['ID'].apply(lambda x: x.split('-')[1], axis=1)
error: () got an unexpected keyword argument 'axis'
DP00010-01
DP00020-01
..........
DP00010-02
Update: Edchum's solution
df['ID'].str.split('-').str[1]
works for me