Closed Mostafasaeed29 closed 2 years ago
in env_stocktrading.py in line 354 def save_action_memory(self): if len(self.df.tic.unique())>1:
date_list = self.date_memory[:-1]
df_date = pd.DataFrame(date_list)
df_date.columns = ['date']
action_list = self.actions_memory
df_actions = pd.DataFrame(action_list)
df_actions.columns = self.data.tic.values
df_actions.index = df_date.date
#df_actions = pd.DataFrame({'date':date_list,'actions':action_list})
else:
date_list = self.date_memory[:-1]
action_list = self.actions_memory
df_actions = pd.DataFrame({'date':date_list,'actions':action_list})
return df_actions
date_list in fact is a empty list so here df_date.columns = ['date'] will cause error I have not solve this error, I think this error is cause by the pandas version. @louisowen6 can I see your pip list?
Hi @xjdbie96, I'm using the requirements.txt from the docker
folder
ok,pandas version is the same.I have used earlier version for FinRL .the earlier version can work.but after update,the trade code appear error for below: trade = data_split(processed_full, '2019-01-01','2021-01-01') e_trade_gym = StockTradingEnv(df = trade, turbulence_threshold = 380, **env_kwargs)
df_account_value, df_actions = DRLAgent.DRL_prediction( model=model_sac, environment = e_trade_gym)
I try to understand the code and I still work on it to fix the problem . @louisowen6
trade = data_split(processed_full, '2019-01-01','2021-01-01') e_trade_gym = StockTradingEnv(df = trade, turbulence_threshold = 380, **env_kwargs)
df_account_value, df_actions = DRLAgent.DRL_prediction( model=model_sac, environment = e_trade_gym)