Is it possible to print things or debug when using Parallel in a Jupyter notebook.
Here is my code
import pandas as pd
from sklearn.model_selection import ParameterGrid
from joblib import Parallel, delayed
def my_func(a,b):
print("hi")
return {"a":a,"b":b},a + b
grid = ParameterGrid({"a": [1, 2],
"b": [3, 4]})
resList = Parallel(n_jobs=-1)(delayed(my_func)(**params) for params in grid)
cols = ['params', 'results']
resDf = pd.DataFrame(resList,columns=cols)
The dataframe contains the correct results but the "hi" lines inside the function don't print