Skip to content

Instantly share code, notes, and snippets.

Ujjwal Kumar kujjwal02

Block or report user

Report or block kujjwal02

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@kujjwal02
kujjwal02 / parallep_apply.py
Last active May 11, 2019
Parallel apply pandas
View parallep_apply.py
# Source: https://towardsdatascience.com/make-your-own-super-pandas-using-multiproc-1c04f41944a1
def parallelize_dataframe(df, func, n_cores=4):
df_split = np.array_split(df, n_cores)
pool = Pool(n_cores)
df = pd.concat(pool.map(func, df_split))
pool.close()
pool.join()
return df
You can’t perform that action at this time.