Use pandas.values.tolist instead of itertuples

speeds up backtesting
closes #4494
This commit is contained in:
Matthias 2021-03-07 11:28:54 +01:00 committed by crypto_rahino
parent 67cf22f85c
commit a86f60df91

View File

@ -206,7 +206,7 @@ class Backtesting:
# Convert from Pandas to list for performance reasons # Convert from Pandas to list for performance reasons
# (Looping Pandas is slow.) # (Looping Pandas is slow.)
data[pair] = [x for x in df_analyzed.itertuples(index=False, name=None)] data[pair] = df_analyzed.values.tolist()
return data return data
def _get_close_rate(self, sell_row: Tuple, trade: LocalTrade, sell: SellCheckTuple, def _get_close_rate(self, sell_row: Tuple, trade: LocalTrade, sell: SellCheckTuple,