0

I have two variables in the data frame waking in date time format that I would like to subtract.

waking['diff2'] = (waking['waketime1'] - waking['waketime2'])

However, I get the error: unsupported operand type(s) for -: 'datetime.time' and 'datetime.time'

How do I overcome this?

user3666197
  • 1
  • 6
  • 50
  • 92
  • Will you please provide a sample of your dataframe? –  Mar 15 '22 at 21:54
  • Does this answer your question? [How to subtract datetimes / timestamps in python](https://stackoverflow.com/questions/31929538/how-to-subtract-datetimes-timestamps-in-python) – JAdel Mar 15 '22 at 21:55
  • Does this answer your question? [Python - Calculate the difference between two datetime.time objects](https://stackoverflow.com/questions/43305577/python-calculate-the-difference-between-two-datetime-time-objects) – Antoine Delia Mar 15 '22 at 22:01

0 Answers0