I have a series that looks like:
ID
WTG-1
11
11-1
12B1
13-1
5
6
G7
.
.
I simply want to be able to extract all the numbers from each ID
.
When I use my code:
df['ID'] = df['ID'].str.extract('(\d+)', expand=True)
It does extract all from the front of the line but skips a number if there is a string/letter/character breaker - ie for 11-1
it only gathers 11
without the extra 1.
I'd like the output to be:
ID ID #
WTG-1 1
11 11
11-1 111
12B1 121
13-1 131
5 5
6 6
G7 7
.
.
Is there a way to count around the characters in between?