User 5167 | 5/1/2016, 8:52:42 PM
I'm battling for hours with the possibility to use the .apply() method with a predefined function, on an SArray that contains more than 180,000 rows, and it seem to call my function only 100 times. can anyone help me with this? I attach the actual code I'm using.
def dictwordcount(dDict, stWord, lstList): # first, define a funtion for a single dict element if stWord in dDict: lstList.append(dDict[stWord]) else: lstList.append(0)
sa = products['wordcount'] # 'products' is an SFrame; 'wordcount' is a dictionary column listawesome =  # create an empty list sa.apply(lambda x: dictwordcount(x, 'awesome', listawesome)) products.addcolumn(graphlab.SArray(listawesome), name='awesome2')