0
I wanted to make a routine that accumulates the data I extract from google Analytics every day, but my code shows an error that I can not solve:
import pandas as pd
import os
import glob
my_dir = 'N:/E-Commerce/Relatorios/Bases/Source/Canais'
filelist = []
filesList = []
os.chdir(my_dir)
for files in glob.glob('*.txt'):
fileName, fileExtension = os.path.splitext(files)
filelist.append(fileName)
filesList.append(files)
df = pd.DataFrame()
for f in filelist:
frame = pd.read_csv(f)
df = df.append(frame)
print(df)
it displays an error that cannot find the file 'b 20180401':
Filenotfounderror: File b'20180401' does not exist
however, the file has name only 20180401 (one file per day).
You did, all right! but I still haven’t been able to create the DF because it gives me the error Unicodedecodeerror: 'utf-8' codec can’t Decode byte 0xff in position 0: invalid start byte so I looked up a python problem in iterating . txt knows how to proceed in this case ?
– João Ricardo Bertti Targino