I have a dataframe consisting of a column of strings. I want to extract the numerical numbers of these strings. However, some of the values are in metres, and some in kilometres. How do i detect that there is a "m" or "km" beside the number, standardize the units then extract the numbers to a new column?
details numbers
Distance 350m
Longest straight 860m
Top speed 305km
Full throttle 61 per cent
Desired output:
details numbers
Distance 350
Longest straight 860
Top speed 305000
Full throttle 61