I have a dataframe column with strings like this:
df.column1:
0 R$ 27.467.522,00 (Vinte e sete milhões, quatro...
1 NaN
2 R$ 35.314.312,12 (Trinta e cinco milhões, trezentos...
3 R$ 1.231,34 (Mil duzentos e trinta e um reais e...
I want only to get the numbers, disconsidering the decimals, so it gets to look like this:
df.column1:
0 27467522
1 NaN
2 35314312
3 1231
I'm trying to do that with regex:
df['column1']=df['column1'].str.extract('[REGEX CODE]')
However I'm not used with Regex. I tried solutions like:
df['column1']=df['column1'].str.extract('(.*?,)').str.extract('(\d+)')
df['column1']=df['column1'].str.extract('(\s*,.*)').str.extract('(\d+)')
But I haven't been able to make it right. Can someone help?