Category : relativedelta

Python 3.8.6 It is surprising that im not able to find the exact same errors in any google results but, it seems datetime‘s timedelta and relativedelta from relativedelta module cannot be compared. Here is the code to replicate: from datetime import timedelta from dateutil import relativedelta timedelta(days=1) < relativedelta.relativedelta(days=1) Output: TypeError Traceback (most recent call ..

Read more

I have 2 years of daily ticker returns and I want to calculate the 6 month historical moving average return for each ticker. My data has 3 columns: date, ticker, return. For example, if current date is 2019-01-31, I want to calculate the average return between 2018-07-31 and 2019-01-31 (excluding the start date). I have ..

Read more