How to do df.apply parallelly ?

barackobama

Active Member
51
3
2,250
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


 

Sponsored