class_docstr: A stock trading environment for OpenAI gym
class_docstr_tok: ["A","stock","trading","environment","for","OpenAI","gym"]
code: def _update_state(self):
      if len(self.df.tic.unique()) > 1:
          # for multiple stock
          state = (
              [self.state[0]]
              + self.data.close.values.tolist()
              + list(
                  self.state[
                      (self.stock_dim + 1) : (self.stock_dim * 2 + 1)
                  ]
              )
              + sum(
                  (
                      self.data[tech].values.tolist()
                      for tech in self.tech_indicator_list
                  ),
                  [],
              )
          )
  
      else:
          # for single stock
          state = (
              [self.state[0]]
              + [self.data.close]
              + list(
                  self.state[
                      (self.stock_dim + 1) : (self.stock_dim * 2 + 1)
                  ]
              )
              + sum(
                  (
                      [self.data[tech]]
                      for tech in self.tech_indicator_list
                  ),
                  [],
              )
          )
  
      return state
  
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 9 for calling the StockTradingEnv obj's underlying member method code with example usage: obj._update_state() and returns: state