How to do df.apply parallelly ?

barackobama

Noobie
LV
0
 
Messages
18
Solutions
1
Points
1,200
I have a code segment

Python:
data_preprocess_segment_5 = df.apply(lambda x: ' '.join(segment(x)))

which takes a lot of time maybe more than 24hrs to process.
I was thinking to do
Python:
df[0:1000].apply(lambda x: ' '.join(segment(x)))
df[1000:2000].apply(lambda x: ' '.join(segment(x)))
df[2000:3000].apply(lambda x: ' '.join(segment(x)))

parallelly and later merge those df
 


Topics You Missed

Advertisement

Latest Posts