def applyParallel(dfGrouped, func):
    retLst = Parallel(n_jobs=multiprocessing.cpu_count())(delayed(func)(
        group) for name, group in dfGrouped)
return pd.concat(retLst)
Parallelize pandas apply