#create filepath for log files for the specific region
region_log_filepath = join(log_files_folder_path, region)
#files stores file paths
files = [join(region_log_filepath, file) for file in listdir(region_log_filepath) if isfile(join(region_log_filepath, file))]
for file in files :
if file.endswith('csv'):
filename = (file.split('Log-')[-1]).split('.csv')[0]
print(f'\nreading file: {filename}')
log_file = pd.read_csv(file,encoding='unicode_escape')
The above code gives the error : UnicodeDecodeError: 'unicodeescape' codec can't decode bytes in position 26850-26851: truncated \UXXXXXXXX escape
I tried looking it up and found a post suggesting to convert it to a raw string. How would I add r' to file in the pd.read_csv() function ?