Created
March 3, 2019 03:08
-
-
Save rish-16/1a4aee33924fdb0fb92cc4f5ae9c0c85 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
import numpy | |
import random | |
actions = ['up', 'down', 'left', 'right'] | |
states = ['start', 'mousetrap', 'empty', 'cheese', 'end'] | |
n_actions = len(actions) | |
n_states = len(states) | |
q_table = pd.DataFrame(np.zeros([n_states, n_actions]), columns=actions) | |
print (q_table) | |
""" | |
up down left right | |
0 0.0 0.0 0.0 0.0 | |
1 0.0 0.0 0.0 0.0 | |
2 0.0 0.0 0.0 0.0 | |
3 0.0 0.0 0.0 0.0 | |
4 0.0 0.0 0.0 0.0 | |
""" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment