i am trying to write several .csv file into one specific directory
here is my code
with open(f+'.csv', 'w', newline='') as csvfile:
writer = csv.writer(csvfile)
writer.writerow(["index", "B", "G", "R"])
for row in rows:
writer.writerow(row)
writer.writerow(["Mean", mean_b/total_b, mean_g/total_g, mean_r/total_r])
writer.writerow("STD", np.sqrt(var_b/total_b), np.sqrt(var_g/total_g), np.sqrt(var_r/total_r))
i have created the csv file into the directory which is same as the .py file however i would like to create a directory and create my csv file in it
i know i need to us os.makedirs() function
but i don't know whether i have to create the directory first and designate the path for the csv file or i simply put the directory name into the open() function
please help me