I have data in a Pandas dataframe in the following format:
Campaign | Spend |
L003-FL-Panama | 800 |
L015, L020 CA- Rancho | 600 |
What I need is to append each value from the Campaign column that starts with a capital 'L' and ends with three digits to a new column. To make matters more complicated, if there are multiple values in this format within a string in the campaign column, then I need each value to be listed in its own new row.
The output would be the following:
Campaign | Spend | Store
L003-FL-Panama | 800 | L003
L015, L020 CA- Rancho | 600 | L015
L015, L020 CA- Rancho | 600 | L020
Apologies if this doesn't make sense, let me know if I can clarify.