Fix pandas access warning

This commit is contained in:
Matthias 2019-11-03 10:38:21 +01:00
parent 500d16620b
commit 1e44f93c31
2 changed files with 3 additions and 3 deletions

View File

@ -245,7 +245,8 @@ class Backtesting:
ticker: Dict = {}
# Create ticker dict
for pair, pair_data in processed.items():
pair_data['buy'], pair_data['sell'] = 0, 0 # cleanup from previous run
pair_data.loc[:, 'buy'] = 0 # cleanup from previous run
pair_data.loc[:, 'sell'] = 0 # cleanup from previous run
ticker_data = self.strategy.advise_sell(
self.strategy.advise_buy(pair_data, {'pair': pair}), {'pair': pair})[headers].copy()

View File

@ -3,7 +3,6 @@ import logging
from unittest.mock import MagicMock
import pytest
from pandas import DataFrame
from freqtrade.data.history import get_timeframe
from freqtrade.optimize.backtesting import Backtesting
@ -313,7 +312,7 @@ def test_backtest_results(default_conf, fee, mocker, caplog, data) -> None:
pair = "UNITTEST/BTC"
# Dummy data as we mock the analyze functions
data_processed = {pair: DataFrame()}
data_processed = {pair: frame.copy()}
min_date, max_date = get_timeframe({pair: frame})
results = backtesting.backtest(
{