Looking for some help.
I have a pandas dataframe column and I want to extract the prefix where such prefix exists in a separate list.
pr_list = ['1 FO-','2 IA-']
Column in df is like
PartNumber ABC DEF 1 FO-BLABLA 2 IA-EXAMPLE
What I am looking for is to extract the prefix where present, put in a new column and leave the rest of the string in the original column.
PartNumber Prefix ABC DEF BLABLA 1 FO- EXAMPLE 2 IA-
Have tried some things like str.startswith but a bit of a python novice and wasn’t able to get it to work.