class_docstr: A stock trading environment for OpenAI gym
class_docstr_tok: ["A","stock","trading","environment","for","OpenAI","gym"]
code: def save_action_memory(self):
      if len(self.df.tic.unique()) > 1:
          # date and close price length must match actions length
          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
  
imports: from __future__ import annotations
  from typing import List
  import gymnasium
  import matplotlib
  import matplotlib.pyplot
  import numpy
  import pandas
  from gymnasium import spaces
  from gymnasium.utils import seeding
  from stable_baselines3.common.vec_env import DummyVecEnv
label_desc: Use image node_id 13 for calling the StockTradingEnv obj's underlying member method code with example usage: obj.save_action_memory() and returns: df_actions