for i in range(len(a)):
a = a[i-2]
print(a)
IndexError: invalid index to scalar variable
So I am getting this index error, when i am trying to loop through my array. A is my array. I looked up the error invalid index to scalar variable online but it looks like its a case by case basis. Any help would be greatly appreciated. Ive tried replacing the for loop to this:
for i in range(len(a)):
a = a(i-2)
print(a)
But that doesn't work and throws up this error.
'numpy.ndarray' object is not callable