keep y axis fixed to 2, csv automation

This commit is contained in:
prisar
2023-07-25 20:13:50 +05:30
parent a709d83693
commit f2b07f63f7
6 changed files with 14 additions and 8 deletions

View File

@@ -2,6 +2,7 @@ import glob
import pandas as pd
import openpyxl
import os
from platform import system
rootdir = os.getcwd()
@@ -45,16 +46,19 @@ def consolidate(curdir):
outfile = rootdir + "/" + os.path.split(curdir)[1] + "_Merged.xlsx"
df_csv_append.to_excel(outfile, index=False)
# df_csv_append.to_excel(outfile, sheet_name="merged_data", index=False)
# df_csv_append.to_csv("D8 Merged.csv", index=False)
writer = pd.ExcelWriter(outfile, engine = 'xlsxwriter')
df_csv_append.to_excel(writer, sheet_name = 'x1')
df_csv_append.to_excel(writer, sheet_name = 'x2')
writer.close()
if __name__ == "__main__":
for file in os.listdir(rootdir):
d = os.path.join(rootdir, file)
curdir = os.path.join(rootdir, file)
if os.path.isdir(d):
# print(d)
# os.chdir(d)
consolidate(d)
consolidate(curdir)