I have a column in a dataframe that looks like this:
COMPRA DE MANTENIMIENTO INSUMOS OT:15424 PLACA:TSW894 OC:28826
and I want to create two new columns in this way:
df[['OT','OC']] = df['FAC_DESC'].str.extract(r'(OT\S*)(OC\S*)')
But is not working, (both columns fill with NaN's)only works when I use only one capture group or when I use '?' between the capture groups, but only catch the last group. I believe I'm missing something...