class_docstr: A portfolio allocation environment for OpenAI gym.
  
  This environment simulates the interactions between an agent and the financial market
  based on data provided by a dataframe. The dataframe contains the time series of
  features defined by the user (such as closing, high and low prices) and must have
  a time and a tic column with a list of datetimes and ticker symbols respectively.
  An example of dataframe is shown below::
  
          date        high            low             close           tic
      0   2020-12-23  0.157414        0.127420        0.136394        ADA-USD
      1   2020-12-23  34.381519       30.074295       31.097898       BNB-USD
      2   2020-12-23  24024.490234    22802.646484    23241.345703    BTC-USD
      3   2020-12-23  0.004735        0.003640        0.003768        DOGE-USD
      4   2020-12-23  637.122803      560.364258      583.714600      ETH-USD
      ... ...         ...             ...             ...             ...
  
  Based on this dataframe, the environment will create an observation space that can
  be a Dict or a Box. The Box observation space is a three-dimensional array of shape
  (f, n, t), where f is the number of features, n is the number of stocks in the
  portfolio and t is the user-defined time window. If the environment is created with
  the parameter return_last_action set to True, the observation space is a Dict with
  the following keys::
  
      {
      "state": three-dimensional Box (f, n, t) representing the time series,
      "last_action": one-dimensional Box (n+1,) representing the portfolio weights
      }
  
  Note that the action space of this environment is an one-dimensional Box with size
  n + 1 because the portfolio weights must contains the weights related to all the
  stocks in the portfolio and to the remaining cash.
  
  Attributes:
      action_space: Action space.
      observation_space: Observation space.
      episode_length: Number of timesteps of an episode.
      portfolio_size: Number of stocks in the portfolio.
class_docstr_tok: ["A","portfolio","allocation","environment","for","OpenAI","gym",".","This","environment","simulates","the","interactions","between","an","agent","and","the","financial","market","based","on","data","provided","by","a","dataframe",".","The","dataframe","contains","the","time","series","of","features","defined","by","the","user","(","such","as","closing",",","high","and","low","prices",")","and","must","have","a","time","and","a","tic","column","with","a","list","of","datetimes","and","ticker","symbols","respectively",".","An","example","of","dataframe","is","shown","below",":",":","date","high","low","close","tic","0","2020-12-23","0.157414","0.127420","0.136394","ADA-USD","1","2020-12-23","34.381519","30.074295","31.097898","BNB-USD","2","2020-12-23","24024.490234","22802.646484","23241.345703","BTC-USD","3","2020-12-23","0.004735","0.003640","0.003768","DOGE-USD","4","2020-12-23","637.122803","560.364258","583.714600","ETH-USD","...","...","...","...","...","...","Based","on","this","dataframe",",","the","environment","will","create","an","observation","space","that","can","be","a","Dict","or","a","Box",".","The","Box","observation","space","is","a","three-dimensional","array","of","shape","(","f",",","n",",","t",")",",","where","f","is","the","number","of","features",",","n","is","the","number","of","stocks","in","the","portfolio","and","t","is","the","user-defined","time","window",".","If","the","environment","is","created","with","the","parameter","return_last_action","set","to","True",",","the","observation","space","is","a","Dict","with","the","following","keys",":",":","{","``","state","''",":","three-dimensional","Box","(","f",",","n",",","t",")","representing","the","time","series",",","``","last_action","''",":","one-dimensional","Box","(","n+1",",",")","representing","the","portfolio","weights","}","Note","that","the","action","space","of","this","environment","is","an","one-dimensional","Box","with","size","n","+","1","because","the","portfolio","weights","must","contains","the","weights","related","to","all","the","stocks","in","the","portfolio","and","to","the","remaining","cash",".","Attributes",":","action_space",":","Action","space",".","observation_space",":","Observation","space",".","episode_length",":","Number","of","timesteps","of","an","episode",".","portfolio_size",":","Number","of","stocks","in","the","portfolio","."]
docstr: Enumerates the current porfolio by showing the ticker symbols
  of all the investments considered in the portfolio.
docstr_tok: ["Enumerates","the","current","porfolio","by","showing","the","ticker","symbols","of","all","the","investments","considered","in","the","portfolio","."]
code: def enumerate_portfolio(self):
      """Enumerates the current porfolio by showing the ticker symbols
      of all the investments considered in the portfolio.
      """
      print("Index: 0. Tic: Cash")
      for index, tic in enumerate(self._tic_list):
          print(f"Index: {index + 1}. Tic: {tic}")
  
imports: from __future__ import annotations
  import math
  import gym
  import matplotlib
  import numpy
  import pandas
  from gym import spaces
  from gym.utils import seeding
  import matplotlib.pyplot
  from stable_baselines3.common.vec_env import DummyVecEnv
  from pathlib import Path
label_desc: Use image node_id 7 for calling the PortfolioOptimizationEnv obj's underlying member method code with example usage: obj.enumerate_portfolio() without return types