for root,dirs,files in os.walk(path): for directory in dirs: for root,dirs,files in os.walk(path+"/"+directory+"/rdc_engineer"): for file in files: if file=="enginner.csv": df=pd.read_csv(path+directory+"/rdc_engineer"+"/"+file) for elements in prediction: df["Engineer Behaviour"]=pd.Series(elements) df.to_csv(path+directory+"/rdc_engineer"+"/"+file,index=False) What I have tried: it just writes the element in the first row of a new col which i want to merge cells of so i want that all the cells in the row "engineer behaviour" should get merged with the element written in it.
pd
prediction
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)