Skip to content

Instantly share code, notes, and snippets.

@lukeorland
Last active September 12, 2019 20:00
Show Gist options
  • Save lukeorland/c707ca852b75cc5658a6ed9694ebbdd4 to your computer and use it in GitHub Desktop.
Save lukeorland/c707ca852b75cc5658a6ed9694ebbdd4 to your computer and use it in GitHub Desktop.
easy multiprocessing apply pandas
import multiprocessing
pool = multiprocessing.Pool(processes=multiprocessing.cpu_count())
df['normalized_text'] = pool.map(normalize_text, df['text'])
pool.close()
pool.join()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment