I have folder where I'm putting updated csv files every day. I'm trying to write a code which will convert csv to excel but whatever I do I have always same issue with : [Errno 2] No such file or directory: ... or if I do not use encoding and try to first read the file then I get another error message: 'utf-8' codec can't decode byte 0xa7 in position 14: invalid start byte
for filename in os.listdir(my_path):
with open(filename, encoding='utf-8') as f:
f = pd.read_csv(os.path.join(my_path, f))
for filename in os.listdir(my_path):
filename = pd.read_csv(os.path.join(my_path, filename))
Any suggestion how can I fix it?