AI4Finance-Foundation / FinRL

FinRL: Financial Reinforcement Learning. 🔥
https://ai4finance.org
MIT License
9.61k stars 2.33k forks source link

Google colab and local environnement give different output for same code #587

Closed dev590t closed 2 years ago

dev590t commented 2 years ago

Description

Google colab and local environnement give different output for same code. That makes some code can't work properly, like in #396 (I have the same issue).

Reproduce bug

Code to run in notebook

DP = DataProcessor('yahoofinance')
data = DP.download_data(config_tickers.DOW_30_TICKER, '2014-01-01', '2020-07-30', '1D')

run code above in local notebook give:

...
[*********************100%***********************]  1 of 1 completed

/home/dev_1/.local/lib/python3.8/site-packages/finrl/finrl_meta/data_processors/processor_yahoofinance.py:53: FutureWarning: The frame.append method is deprecated and will be removed from pandas in a future version. Use pandas.concat instead.
  data_df = data_df.append(temp_df)

[*********************100%***********************]  1 of 1 completed
[*********************100%***********************]  1 of 1 completed

/home/dev_1/.local/lib/python3.8/site-packages/finrl/finrl_meta/data_processors/processor_yahoofinance.py:53: FutureWarning: The frame.append method is deprecated and will be removed from pandas in a future version. Use pandas.concat instead.
  data_df = data_df.append(temp_df)
/home/dev_1/.local/lib/python3.8/site-packages/finrl/finrl_meta/data_processors/processor_yahoofinance.py:53: FutureWarning: The frame.append method is deprecated and will be removed from pandas in a future version. Use pandas.concat instead.
  data_df = data_df.append(temp_df)

Shape of DataFrame:  (48368, 9)

run code above in Colab give:

...
[*********************100%***********************]  1 of 1 completed
[*********************100%***********************]  1 of 1 completed
[*********************100%***********************]  1 of 1 completed
[*********************100%***********************]  1 of 1 completed
Shape of DataFrame:  (48339, 9)

Expected result

should give dataframe with same shape

Possible cause

Finrl can't run correctly with some version of libraries or python interpreter

Athe-kunal commented 2 years ago

Hi @dev590t. Is this after adding the technical indicators?

dev590t commented 2 years ago

Is this after adding the technical indicators?

@Athe-kunal , yes the result are different after adding the technical indicators. But as the data downloaded are different, it is normal that adding the technical indicators give different output

dev590t commented 2 years ago

I have reproduce the package environment of Colab, and use the same python version(python 3.7), in my local machine. The output of my local machine is still different than Colab. I don't understand how it is possible.

dev590t commented 2 years ago

I test with alpaca DataProcessor, both environment give same shape for downloaded data. It seem it is a specific issue with yahoofinance