Skip to content

Instantly share code, notes, and snippets.

@Nicolas-Vandeput
Created July 3, 2021 16:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Nicolas-Vandeput/96b430e8760f25d259696fdc472d737b to your computer and use it in GitHub Desktop.
Save Nicolas-Vandeput/96b430e8760f25d259696fdc472d737b to your computer and use it in GitHub Desktop.
def loop(file_number):
return pd.read_csv(f"Dummy {file_number}.csv")
df = Parallel(n_jobs=-1, verbose=10)(delayed(loop)(file_number) for file_number in range(10))
#equivalent to
df = [loop(file_number) for file_number in range(10)]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment