<jupyter_start><jupyter_text>gym env registry<jupyter_code># load environment
env = gym.envs.make("MountainCar-v0")
print(gym.envs.registry.all())<jupyter_output>dict_values([EnvSpec(Copy-v0), EnvSpec(RepeatCopy-v0), EnvSpec(ReversedAddition-v0), EnvSpec(ReversedAddition3-v0), EnvSpec(DuplicatedInput-v0), EnvSpec(Reverse-v0), EnvSpec(CartPole-v0), EnvSpec(CartPole-v1), EnvSpec(MountainCar-v0), EnvSpec(MountainCarContinuous-v0), EnvSpec(Pendulum-v0), EnvSpec(Acrobot-v1), EnvSpec(LunarLander-v2), EnvSpec(LunarLanderContinuous-v2), EnvSpec(BipedalWalker-v2), EnvSpec(BipedalWalkerHardcore-v2), EnvSpec(CarRacing-v0), EnvSpec(Blackjack-v0), EnvSpec(KellyCoinflip-v0), EnvSpec(KellyCoinflipGeneralized-v0), EnvSpec(FrozenLake-v0), EnvSpec(FrozenLake8x8-v0), EnvSpec(CliffWalking-v0), EnvSpec(NChain-v0), EnvSpec(Roulette-v0), EnvSpec(Taxi-v2), EnvSpec(GuessingGame-v0), EnvSpec(HotterColder-v0), EnvSpec(Reacher-v2), EnvSpec(Pusher-v2), EnvSpec(Thrower-v2), EnvSpec(Striker-v2), EnvSpec(InvertedPendulum-v2), EnvSpec(InvertedDoublePendulum-v2), EnvSpec(HalfCheetah-v2), EnvSpec(HalfCheetah-v3), EnvSpec(Hopper-v2), EnvSpec(Hopper-v3), EnvSpec(Swimmer-v2), EnvSp[...]<jupyter_text>observation and action spaces<jupyter_code># learn about the environment
print(env.action_space)
print(env.observation_space)
print(env.observation_space.high)
print(env.observation_space.low)
print(env.observation_space.bounded_above)
print(env.observation_space.bounded_below)

space = gym.spaces.Discrete(3)
x = space.sample()
print(space.contains(x))
print(space.n == 3)<jupyter_output>Discrete(3)
Box(2,)
[0.6  0.07]
[-1.2  -0.07]
[ True  True]
[ True  True]
True
True
{'fraction_non_alphanumeric': 0.15356711003627568, 'fraction_numerical': 0.034461910519951636, 'mean_word_length': 9.474683544303797, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '355900', 'license': 'MIT', 'n_tokens_mistral': 705, 'n_tokens_neox': 679, 'n_words': 78, 'path': '_MyRL/learn_about_gym.ipynb', 'repo_name': 'Magic-wei/reinforcement-learning', 'size': '1654'}