Jan-17-2021, 02:01 AM
I have a numpy 2darray called d5. I'm trying to get values from row#1 [0]. and I'm comparing them with values from row#2 [1]. If values from row#2 are not equal, then advance to row#3 and iterate until you find a match. Here is the code that is throwing an error for me, along with the error message it self. Bare with me cause i'm really a newbie, and there may be ALOT wrong with what I'm doing!
lay_1 = 1
a = 0
b = lay_1
del5_counter = 0
draw_del5 = np.array(d5[a][1] - d5[a][0], d5[a][2] - d5[a][1], d5[a][3] - d5[a][2], d5[a][4] - d5[a][3])
for row in d5:
del5_1 = np.array(d5[b][1] - d5[b][0], d5[b][2] - d5[b][1], d5[b][3] - d5[b][2], d5[b][4] - d5[b][3])
if del5_1 != draw_del5:
b += 1
del5_counter += 1
else:
break
Traceback (most recent call last):
File "C:\Users\Brian\MyPythonScripts\working.py", line 177, in <module>
draw_del5 = np.array(d5[a][1] - d5[a][0], d5[a][2] - d5[a][1], d5[a][3] - d5[a][2], d5[a][4] - d5[a][3])
TypeError: array() takes from 1 to 2 positional arguments but 4 were given
