I have a column in a Dataset where the time format is in 'aHrs bMin' .I need to convert this string to float value.
Example
Input = 2H 30M Output = 2.5
you can make a function for that,
import re
def gettf(s):
sh, sm ="0","0"
vals= s.split(" ")
sh = vals[0]
if len(vals)>1:
sm = vals[1]
t = float(re.findall("\d+", sh)[0]) + float(re.findall("\d+", sm)[0])/60
return t
example :
print(gettf("5H 45M"))
output: 5.75