Skip to content

Commit 35e16ea

Browse files
committed
[Fix] Ensure formatted string values can be assigned in MultiBacktestResults display DataFrame
1 parent b0c5770 commit 35e16ea

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/quanteval/core/backtester.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,8 @@ def __repr__(self) -> str:
314314
available_cols = [c for c in cols_map.keys() if c in summary_df.columns]
315315

316316
if available_cols:
317-
display_df = cast(pd.DataFrame, summary_df[available_cols].copy())
317+
# Ensure we can assign formatted string values into the frame
318+
display_df = cast(pd.DataFrame, summary_df[available_cols].copy()).astype(object)
318319
for c in available_cols:
319320
fmt = cols_map[c][1]
320321
column = cast(pd.Series, display_df[c])

0 commit comments

Comments
 (0)