A similar question has been asked before but has received no responses
I have looked through a number of forums for a solution. The other questions involve a year but mine does not - it is simply H:M:S
I web scraped this data which returned
Time - 36:42 38:34 1:38:32 1:41:18
Data samples here: Source data 1 and Source data 2
I need this time in minutes like so 36.70 38.57 98.53 101.30
To do this I tried this:
time_mins = []
for i in time_list:
h, m, s = i.split(':')
math = (int(h) * 3600 + int(m) * 60 + int(s))/60
time_mins.append(math)
But that didn't work because 36:42 is not in the format H:M:S, so I tried to convert 36:42 using this
df1.loc[1:,6] = df1[6]+ timedelta(hours=0)
and this
df1['minutes'] = pd.to_datetime(df1[6], format='%H:%M:%S')
but have had no luck.
Can I do it at the extraction stage? I have to do it for over 500 rows
row_td = soup.find_all('td')
If not, how can it do it after conversion into a data frame
Thanks in advance