Skip to content

Instantly share code, notes, and snippets.

@ByungSunBae
Created February 11, 2020 00:58
Show Gist options
  • Save ByungSunBae/c2c8a7e4b5c085d4eb64c7ec2b8e7ff2 to your computer and use it in GitHub Desktop.
Save ByungSunBae/c2c8a7e4b5c085d4eb64c7ec2b8e7ff2 to your computer and use it in GitHub Desktop.
simply multiple read files with multiprocessing in python
# from : https://stackoverflow.com/questions/36587211/easiest-way-to-read-csv-files-with-multiprocessing-in-pandas
import os
import pandas as pd
from multiprocessing import Pool
from glob import glob
data_files = glob(os.path.join(data_dir, "*.xlsx"))
if __name__ == '__main__':
with Pool(processes=len(data_files)) as pool:
df_list = pool.map(pd.read_excel, data_files)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment