Skip to content

Instantly share code, notes, and snippets.

@mindey
Last active Oct 20, 2017
Embed
What would you like to do?
import pandas
import multiprocessing
def apply_parallel(grouped_df, func):
with multiprocessing.Pool(multiprocessing.cpu_count()) as p:
ret_list = p.map(func, [group for name, group in grouped_df])
return pandas.concat(ret_list)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment