The code
The import numpy as np
A=np. Array ([0, 1])
Def f (x) :
Return [0, 1] [x]
F (a)
Feedback error message:
TypeError: only integer scalar arrays can be converted to a scalar index
Who know what reason be excuse me?
The import numpy as np
A=np. Array ([0, 1])
Def f (x) :
Return [0, 1] [x]
F (a)