After reading data from database, I want to return data and write it to a csv file. How to use multi-processing to do it?
def get_data(): data = get_data_from_database() #a dataframe data.to_csv('data.csv', index=False) #step 1: write to csv file return data #step 2: return data How to use multi-processing to do step 1 and step 2?
streaming?