Home > other >  How to get the 2 d array element in python as function arguments
How to get the 2 d array element in python as function arguments

Time:11-01

Encounter a problem, the requirement to define a function updateR (R (I, t)), will be known array R (I, t) position of the element as a parameter, resulting from the operation function R (I, t + 1),

Such as, known array R:
 R=[[1 1 0 0] 
[0, 1, 0, 1]
[0 0 5 1]
[1 1 1 0]
[1 1 0, 1]
[1 1 0 0]
[0, 1, 0, 1]
[0 0 0 1)
[1 1 0, 1]]


Run updateR (R (2, 1]) after value should be R (2, 2], which may, however, when my definition updateR:
 def updateR (R/I, t) : 

Will display a SyntaxError: invalid syntax, probably because I use square brackets in the parameter? Excuse me everybody, this kind of circumstance should be how to solve?
  • Related