Just use the modulo operator.
import pandas as pd pd.to_timedelta('-1 days 2:45:00') % pd.Timedelta(hours=24)