I have a pandas dataframe that I am trying to manipulate so that the 'amount' column converts from a string ("hh.hh 'hours'") to an int or float.
I am wondering what the best practice is in this situation. I have tried pd.to_numeric(), but without success. I think my problem is with the 'hours' tacked on the end of each string.
Is there another function that will identify numeric characters and simply ignore the 'hours' portion of the string, or do I first need to trim the last 5 characters before working with the built in dtype conversion function (pd.to_numeric)? Thanks!
day amount
2018-08-23 3 24.00 hours
2018-08-24 4 8.00 hours
2018-08-25 5 32.00 hours
2018-08-26 6 24.00 hours
2018-08-27 0 24.00 hours
'hours'would be easiest i think. should be pretty quick to do