I want to run a function using concurrent
in Python. This is the function that I have :
import concurrent.futures
import pandas as pd
import time
def putIndf(file):
listSel = getline(file)
datFram = savetoDataFrame(listSel)
return datFram #datatype : dataframe
def main():
newData = pd.DataFrame()
with concurrent.futures.ProcessPoolExecutor(max_workers=30) as executor:
for i,file in zip(fileList, executor.map(dp.putIndf, fileList)):
df = newData.append(file, ignore_index=True)
return df
if __name__ == '__main__':
main()
I want to join dataframe to be one dataframe newData
, but the result is only the last dataframe from that function