Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

process rows of dataframe in parallel

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
 
PREVIOUS NEXT
Tagged: #process #rows #dataframe #parallel
ADD COMMENT
Topic
Name
2+7 =