import pandas as pd
df = pd.DataFrame({'Date':['This 1-A16-19 person is BL-17-1111 and other',
'dont Z-1-12 do here but NOT 12-24-1981',
'numbers: 1A-256-29Q88 ok'],
'IDs': ['A11','B22','C33'],
})
Using the dataframe
above I want to do the following 1) Use regex
to identify all digit + number combination e.g 1-A16-19
2) Store in dictionary
Ideally I would like the following output (note that 12-24-1981
intentionally was not picked up by the regex since it doesn't have a letter in it e.g. 1A-24-1981
)
{1: 1-A16-19, 2:BL-17-1111, 3: Z-1-12, 4: 1A-256-29Q88}
Can anybody help me do this?