Closed AggamR closed 3 years ago
Its a numpy array, you can use
def strategy(history, memory):
round_nr = history.shape[1]
my_hist = list(history[0])
opp_hist = list(history[1])
to transform it to lists
History is a 2d NP array. So
a = [
[1,0,1,0...],
[0,0,0,0...]
]
You can access it just like a normal python list
a[0][0] == 1
History is a 2d NP array. So
a = [ [1,0,1,0...], [0,0,0,0...] ]
You can access it just like a normal python list
a[0][0] == 1
oh so a[0] is my actions and a[1] is the opponent's actions? or vise versa? or not that at all? also, do I need to turn it into a python list first, like @peterHoburg mentioned? or can I just do that on the array?
History is a 2d NP array. So
a = [ [1,0,1,0...], [0,0,0,0...] ]
You can access it just like a normal python list
a[0][0] == 1
oh so a[0] is my actions and a[1] is the opponent's actions? or vise versa? or not that at all? also, do I need to turn it into a python list first, like @peterHoburg mentioned? or can I just do that on the array?
I guess you can do whatever you want. @peterHoburg was just giving you a suggestion if you didn't want to work with np arrays.
History is a 2d NP array. So
a = [ [1,0,1,0...], [0,0,0,0...] ]
You can access it just like a normal python list
a[0][0] == 1
oh so a[0] is my actions and a[1] is the opponent's actions? or vise versa? or not that at all? also, do I need to turn it into a python list first, like @peterHoburg mentioned? or can I just do that on the array?
I guess you can do whatever you want. @peterHoburg was just giving you a suggestion if you didn't want to work with np arrays.
oh ok, but I still have a question:
so a[0] is my actions and a[1] is the opponent's actions? or vise versa? or not that at all?
History is a 2d NP array. So
a = [ [1,0,1,0...], [0,0,0,0...] ]
You can access it just like a normal python list
a[0][0] == 1
oh so a[0] is my actions and a[1] is the opponent's actions? or vise versa? or not that at all? also, do I need to turn it into a python list first, like @peterHoburg mentioned? or can I just do that on the array?
I guess you can do whatever you want. @peterHoburg was just giving you a suggestion if you didn't want to work with np arrays.
oh ok, but I still have a question:
so a[0] is my actions and a[1] is the opponent's actions? or vise versa? or not that at all?
a[0] are your actions.
Possible duplicate of #22
@Niels-van-den-Hork and @peterHoburg are correct! It's a 2D numpy array where the first axis is which player it is (0th row is your history, 1st row is your opponent's history) and the second axis is what turn it is
Is it supposed to be a list? a numpy array?
Also, sorry for the stupid question, just never worked with NP, and it's not clear to me.