This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def total_seconds(timedelta): | |
"""Convert timedeltas to seconds | |
In Python, time differences can take many formats. This function can take | |
timedeltas in any format and return the corresponding number of seconds, as | |
a float. | |
Beware! Representing timedeltas as floats is not as precise as representing | |
them as a timedelta object in datetime, numpy, or pandas. |