Running on Windows 10. I am adding the code from your original Jupyter notebook into my own, and the only other change is to redefine paths on the notebook and config.py for my own situation.
When train = parallelize_dataframe(train, process_comment) is run then the code hangs indefinitely. In the jupyter notebook console I can see that parallelize_dataframe cannot actually resolve the passed function, so nothing is actually happening:
AttributeError: Can't get attribute 'process_comment' on <module 'main' (built-in)>
Could this be a peculiarity of my environment?
UPDATE - Definitely a peculiarity of my environment:
Is it possible to define parallelize_dataframe so it copes with a Windows environment (see below)?
Running on Windows 10. I am adding the code from your original Jupyter notebook into my own, and the only other change is to redefine paths on the notebook and config.py for my own situation.
When
train = parallelize_dataframe(train, process_comment)
is run then the code hangs indefinitely. In the jupyter notebook console I can see that parallelize_dataframe cannot actually resolve the passed function, so nothing is actually happening:AttributeError: Can't get attribute 'process_comment' on <module 'main' (built-in)>
Could this be a peculiarity of my environment?
UPDATE - Definitely a peculiarity of my environment: Is it possible to define parallelize_dataframe so it copes with a Windows environment (see below)?
See: https://stackoverflow.com/questions/37103243/multiprocessing-pool-in-jupyter-notebook-works-on-linux-but-not-windows https://docs.python.org/2/library/multiprocessing.html#windows
Resolved by wrapping
if __name__ == '__main__'