My python code employs multiprocessing. There is a dataframe which is created in the shared memory in the parent program, lets say, ns.df where ns is the namespace manager instance.
The multiple processes need to add rows of data to this ns.df, so that all changes are reflected, once the processes terminate, in the parent program.
The processes are not required to interact with each other as in there is no sharing or passing of data between processes. The data to be written by each process is exclusive and independent of that process only.
Woluld doing a simple
ns.df = pd.concat([ns.df, tempdf], axis=0, sort=True)
from within each of the child processes suffice in achieving the desired result? Here tempdf be the dataframe with the required data to be added to ns.df.
How can i achieve this in python? Any help would be appreciated.
@mrzothanku for your reply. I am working on the solution provided by you and got stuck with another small thingy!! :) Is there a way to turn the following piece of code into a list comprehension??child_id=0 for item in finalargpool: item.append(child_id) child_id+=1