TypeError: zip argument #2 must support iteration

It sounds like you have three arrays itemNameListarray_x, and array_y

Assuming they are all the same shape, you can just do:

zipped = zip(itemNameList,array_x,array_y)
li_result = list(zipped)

EDIT

Your problem is that array_x and array_y are not actual numpy.array objects, but likely numpy.int32 (or some other non-iterable) objects:

array_x = np.int32(np.zeros(None))
array_x.shape
# ()
array_x.__iter__
# AttributeError: 'numpy.int32' object has no attribute '__iter__'

Perhaps their initialization is not going as expected, or they are being changed from arrays somewhere in your code?

Leave a Comment