I have a table column (df1[‘income’]), shown below, and I want to extract just the first prices.
|Approx £1,000000 £2 psf|
|Expected £520000 £3.2 psf|
pattern = re.compile(r'£.........') matches = pattern.finditer(str(df1['Income'])) for match in matches: print(match)
The issue is the first code extracts both prices and the second code removes all the characters, rather than splitting them how I’d want.
All help greatly appreciated, thanks.
Source: Python Questions