Eli Treuherz
01/26/2022, 5:20 PMTask.map() it iterates through both of them together like zip() . Is there a way to loop over every combination instead, like itertools.product()?Kevin Kho
Eli Treuherz
01/26/2022, 5:21 PMEli Treuherz
01/26/2022, 5:22 PMKevin Kho
a, b = product()
other_task.map(a, b)Eli Treuherz
01/26/2022, 5:23 PMEli Treuherz
01/26/2022, 5:23 PMKevin Kho
a and b here will be expanded lists already like a=[1,1,1,2,2,2,3,3,3] , b=["a","b",""c","a","b",""c","a","b",""c"]. I dunno I might just be confusing you 😅. I think you understand it alreadyEli Treuherz
01/26/2022, 5:25 PMEli Treuherz
01/26/2022, 5:30 PMIn [14]: tuple(map(list, zip(*product(["A", "B", "C"], ["1", "2", "3"]))))
Out[14]:
(['A', 'A', 'A', 'B', 'B', 'B', 'C', 'C', 'C'],
['1', '2', '3', '1', '2', '3', '1', '2', '3'])
💪Kevin Kho