I wanted to do a routine that accumulates the data I extract from google analytics every day, but my code has 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 presents an error that can not find file 'b 20180401':
FileNotFoundError: File b'20180401 'does not exist
However, the file only has a name of 20180401 (one file per day).