1

I have a feeling this should be easily possible, but I fail to pass combinations of (lazy) lists to a delayed function:

def test(a,b):
    return(str(a)+','+str(b))

a = [1,2] #not lazy for example
b = [3,4] #not lazy
c = dask.delayed(test)(a,b)
c = c.compute()
out:
'[1,2][3,4]'
desired output:
['1,3','1,4','2,3','2,4']

Also tried:

def test(c):
    a = c[0]
    b = c[1]
    return(str(a)+','+str(b))

def combine_a_b(a,b):
    return([(i,j) for i in a for j in b])

c = dask.delayed(combine_a_b)(a,b)
c = dask.delayed(test)(c)
c = c.compute()
out:
'(1,3)(1,4)'

What am I doing wrong here?

Willem
  • 593
  • 1
  • 8
  • 25

0 Answers0