parallel-pandas
parallel-pandas copied to clipboard
when rolling(30).p_apply() it says "np doesn't exist"
so in p_apply I call this function that uses numpy or whatever 3rd party package, and it says the package doesn't exist?
Сan you provide a reproducible example?
I ran into this same issue I think. The problem is on windows the multi-processing behaviour creates whole new Python instance and so all global variables (including imports) are lost.
The solution is either to make the function being applied fully self contained (i.e. with its own imports etc.) or to pass the keyword argument executor=‘threads’ to the apply function to force it to use threads instead of processes.