lambda workers do not import modules from particular directory.

User 1228 | 12/4/2015, 12:05:06 PM

Is there a way to tell lambda workers - using apply() on a sframe - to import a module from a specific directory?

Comments

User 954 | 12/7/2015, 8:11:51 AM

yes you can. `

ipython !echo "def f(x,y): return x + y" >> th.py def test_func(x): from th import f return f(4,x) import graphlab as gl sa = gl.SArray([1,2]) sa.apply(lambda x: f(x)) `


User 1228 | 12/10/2015, 10:35:56 AM

thx