I'm not sure where to start with this one.
I have a list of obsolete items with a new item_code listed somewhere in the description column. Item codes are always between 8 & 12 characters so all other numbers in the description should be ignored.
import pandas as pd df1 = pd.DataFrame({'Item_Code': ['00001234', '00012345', '00123456', '01234567'], 'Desc': ['Widget1 - Obsolete Use Alternative 56789100', 'Obsolete Widget 2 - Use Alternative 56789100 - Blah Blah Blah', 'Alternative Use 9999999910 - Blah Blah Blah', 'Obsolete use 99999999911']}, index=[0, 1, 3, 4]) print(df1.head(10)) So ideally I'm looking to have the alternative codes in a new column.

