I have a dataframe with to columns looking like this:
c1.1 c1.2
2019-11-01 00:15:00+01:00 1260.00304232804
2019-11-01 00:30:00+01:00 402.552212643678
2019-11-01 00:45:00+01:00 524.666157608132
2019-11-01 01:00:00+01:00 476.758148148148
2019-11-01 01:15:00+01:00 492.47544534413
I would like to convert both to floats. I have tried using df['c1.1'].astype(float)
, however, this does not work due to the first column being datetime.datetime. I get the following error: float() argument must be a string or a number, not 'datetime.datetime'
I've also tried converting both columns to strings, before turning them into floats, but this is also not working. Error: could not convert string to float: '2019-11-01 00:15:00+01:00'
Does anyone know how to solve this problem? Thank you!