Skip to content

Instantly share code, notes, and snippets.

Avatar

Tejas Lodaya tejaslodaya

View GitHub Profile
@tejaslodaya
tejaslodaya / apply_df_by_multiprocessing.py
Created Feb 3, 2017
pandas DataFrame apply multiprocessing
View apply_df_by_multiprocessing.py
import multiprocessing
import pandas as pd
import numpy as np
def _apply_df(args):
df, func, num, kwargs = args
return num, df.apply(func, **kwargs)
def apply_by_multiprocessing(df,func,**kwargs):
workers=kwargs.pop('workers')