I have the dataframe above and I wish to convert it into a csv file.
I am currently using df.to_csv('my_file.csv') to convert it but I want to leave 3 blanks columns. For the rows of the file above I have the following procedure.
dirname = os.path.dirname(os.path.abspath(__file__))
csvfilename = os.path.join(dirname, 'MainFile.csv')
with open(csvfilename, 'wb') as output_file:
writer = csv.writer(output_file, delimiter=',')
writer.writerow([])
writer.writerow(["","Amazon","Weekday","Weekend"])
writer.writerow(["","Ebay",wdvad,wevad])
writer.writerow(["","Kindle",wdmpv,wempv])
writer.writerow([])
I want to incorporate the data frame right after the blanks space with three blank columns. How can I add the dataframe in continuation to the existing csv file so that I can also add more rows with data after the dataframe.
