I have a dataset with many columns. I would like to search in one of these any numbers:
Column_to_look_at
10 days ago I was ...
How old are you?
I am 24 years old
I do not know. Maybe 23.12?
I could21n ....
I would need to create two columns: one which extracts the numbers included in that column and another one which just has boolean values if a row contains or does not a number.
Output I would expect
Column_to_look_at Numbers Bool
10 days ago I was ... [10] 1
How old are you? [] 0
I am 24 years old [24] 1
I do not know. Maybe 23.12 or 23.14? [23.12, 23.14] 1
I could21n .... [21] 1
The code I applied to select numbers is this
df[df.applymap(np.isreal).all(1)]
but actually this is not give me the outpuut expected (at least for number selection). Any suggestions on how to extract digits from that column would be appreciated. Thanks