There was an error while loading. Please reload this page.
1 parent cadcbe2 commit d1cce7aCopy full SHA for d1cce7a
1 file changed
backtesting/_stats.py
@@ -196,9 +196,11 @@ def __repr__(self):
196
'display.max_colwidth', 20, # Prevent expansion due to _equity and _trades dfs
197
'display.max_rows', len(self), # Reveal self whole
198
'display.precision', 5, # Enough for my eyes at least
199
- # 'format.na_rep', '--', # TODO: Enable once it works
200
):
201
- return super().__repr__()
+ # XXX: .fillna(nan) to replace None which aren't na_rep'd otherwise (pandas 3.0).
+ # Replace with proper na_rep option when that becomes available.
202
+ # https://github.com/pandas-dev/pandas/issues/66407
203
+ return super().fillna(np.nan).to_string(na_rep='--', dtype=True)
204
205
206
def dummy_stats():
0 commit comments