Skip to content

Commit b21b4b6

Browse files
committed
REF: Improve Series repr formatting
1 parent dc10b30 commit b21b4b6

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

backtesting/_stats.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,10 @@ def _round_timedelta(value, _period=_data_period(index)):
155155

156156
class _Stats(pd.Series):
157157
def __repr__(self):
158-
# Prevent expansion due to _equity and _trades dfs
159-
with pd.option_context('max_colwidth', 20):
158+
with pd.option_context(
159+
'display.max_colwidth', 20, # Prevent expansion due to _equity and _trades dfs
160+
'display.max_rows', len(self), # Reveal self whole
161+
'display.precision', 5, # Enough for my eyes at least
162+
# 'format.na_rep', '--', # TODO: Enable once it works
163+
):
160164
return super().__repr__()

0 commit comments

Comments
 (0)