Created
February 11, 2020 00:58
-
-
Save ByungSunBae/c2c8a7e4b5c085d4eb64c7ec2b8e7ff2 to your computer and use it in GitHub Desktop.
simply multiple read files with multiprocessing in python
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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