move convert to csv and let it automatically create out folder

This commit is contained in:
2021-04-21 18:38:41 +02:00
parent fe225e67ea
commit d5d6f7017e
2 changed files with 15 additions and 9 deletions

View File

@@ -1,9 +0,0 @@
import pandas as pd
import os
# Convert data to csv
for dirname, _, filenames in os.walk('input'):
for filename in filenames:
read_file = pd.read_excel (os.path.join(dirname, filename))
read_file.to_csv (os.path.join('csv', filename.split(".", 1)[0] + ".csv"), index = None, header=True)