Verify whether the backtest result data frame contains data before attempting to drop the cumulative profit column

This commit is contained in:
moshferatu 2024-01-21 05:56:06 -08:00
parent ad5bbc3c10
commit 1402ab88cc

View File

@ -50,6 +50,8 @@ def run_backtest(start_date: datetime, end_date: datetime):
start_date,
end_date
)
if not backtest_results.empty:
# TODO: Think of a better way to handle this.
backtest_results.drop('Cumulative Profit', axis = 1, inplace = True)
print(backtest_results)