Merge pull request #2468 from freqtrade/fix_pandas_wraning

Fix pandas access warning
This commit is contained in:
hroff-1902 2019-11-04 15:32:05 +03:00 committed by GitHub
commit 54b0fbca59
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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(
{