Open wony-zheng opened 5 months ago
def _qtd(df): date = _dt.datetime.now() for q in [1, 4, 7, 10]: if date.month <= q: return df[df.index >= _dt.datetime(date.year, q, 1).strftime("%Y-%m-01")] return df[df.index >= date.strftime("%Y-%m-01")]
when today.month == 2 ,it loc df.index >= 'xxxx-04-01'
Check out https://github.com/Lumiwealth/quantstats_lumi, which is being updated regularly. We are a fork of this library that is being maintained by Lumiwealth
def _qtd(df): date = _dt.datetime.now() for q in [1, 4, 7, 10]: if date.month <= q: return df[df.index >= _dt.datetime(date.year, q, 1).strftime("%Y-%m-01")] return df[df.index >= date.strftime("%Y-%m-01")]
when today.month == 2 ,it loc df.index >= 'xxxx-04-01'