I have this value 10-X-002 in a column and I want to extract only the X-002 to be in a new column.
So far what I have tried was this:
mask = df["eq_id"].str.count('-').gt(0)
splitted = df["eq_id"].str.split("-")
df.loc[mask, "eg_number"] = splitted[mask].str[-1]
but the script resulted only the 002 is in the new column, what should I do to get X-002 value in the new column?
Thankyou.

splitted = df["eq_id"].str.split("-",1)