Is there a way to do something like this for each list in a numpy array without combining?:
for item, nextItem in zip(list,list[1::]):
My numpy array:
for i in range(0, len(list1), lines):
array1 = np.array(list1[i:i+lines])
SAMPLE OUTPUT:
['23' '23' '23' '23']
['43' '43' '63' '43']
['43' '43' '43' '43']
I would like to step through the numpy array, to compare item/nextItem in each list without combining them? Zip is working for me on a regular list:
for item, nextItem in zip(list,list[1::]):
if item != nextItem:
#do stuff
Thanks in advance. Any insight would be appreciated.