MCPcopy
hub / github.com/ranaroussi/quantstats / _match_dates

Function _match_dates

quantstats/reports.py:43–51  ·  view source on GitHub ↗
(returns, benchmark)

Source from the content-addressed store, hash-verified

41
42
43def _match_dates(returns, benchmark):
44 if isinstance(returns, _pd.DataFrame):
45 loc = max(returns[returns.columns[0]].ne(0).idxmax(), benchmark.ne(0).idxmax())
46 else:
47 loc = max(returns.ne(0).idxmax(), benchmark.ne(0).idxmax())
48 returns = returns.loc[loc:]
49 benchmark = benchmark.loc[loc:]
50
51 return returns, benchmark
52
53
54def html(

Callers 5

htmlFunction · 0.85
fullFunction · 0.85
basicFunction · 0.85
metricsFunction · 0.85
plotsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected