I have a dataframe with a column that holds certain values where I would like to extract the second string after the hyphen and keep the original.
Data
type stat
SSS-AA-11111 y
FFF-BB-22222 y
Desired
type type1 stat
SSS-AA-11111 AA y
FFF-BB-22222 BB y
Doing
df[['type', 'type1']] = df['type'].str.split('-', 1, expand=True)`
I get this error:
ValueError: Columns must be same length as key
I am still researching. Any suggestion is appreciated