fb_pixel

Error: '<' not supported between instances of 'tuple' and 'int'

Development | Programming languages
Description
I am trying to update existing excel file by using this code:

import openpyxl
import zipfile
from shutil import copyfile
from shutil import rmtree
import os
import pandas as pd
PAD = os.getcwd()
mydir = (os.getcwd()).replace('\\', '/') + '/'
wb = openpyxl.load_workbook(mydir + 'Governance_Tracker - Copy - Copy.xlsm')
myOutlook_inBox = pd.read_csv(r'' + mydir + 'test.CSV', usecols=['Subject', 'Body', 'From: (Name)', 'To: (Name)'],
                              encoding='latin-1')
all_data = pd.read_excel(r'' + mydir + 'Governance_Tracker - Copy - Copy.xlsm'
,header = 1).drop(['#'], axis=1)
print(all_data)
myOutlook_inBox.columns = myOutlook_inBox.columns.str.replace(' ', '')
# this object extract 5 chars and 5 numbers from specific column in csv
replaced_sbj_value = myOutlook_inBox['Subject'].str.extract(pat='(L(?:DEL|CAI|SIN).\d{5})').dropna()
# this columns I want to filter in database
myOutlook_inBox["Subject"] = replaced_sbj_value
frm_mwfy_to_te = myOutlook_inBox.loc[myOutlook_inBox['From:(Name)'].str.contains("mowafy", na=False) \
                                     & myOutlook_inBox['To:(Name)'].str.contains("te", na=False)] \
                     .drop_duplicates(keep=False)
filtered_data_cond1 = all_data.loc[all_data['SiteCode'].str.contains('|'.join(frm_mwfy_to_te.Subject))]
values = tuple(filtered_data_cond1[['SiteCode']].values.tolist())
#####
# do magic with openpyxl here and save
ws = wb.worksheets[0]
ws.cell(row=values, column=4).value = 'Edited'   # example
#####
wb.save('Governance_Tracker - Copy - Copy446548945.xlsx')

with zipfile.ZipFile('1.xlsm', 'r') as z:
    z.extractall('./xlsm/')
with zipfile.ZipFile('2.xlsx', 'r') as z:
    z.extractall('./xlsx/')
copyfile('./xlsm/[Content_Types].xml','./xlsx/[Content_Types].xml')
copyfile('./xlsm/xl/_rels/workbook.xml.rels','./xlsx/xl/_rels/workbook.xml.rels')
copyfile('./xlsm/xl/vbaProject.bin','./xlsx/xl/vbaProject.bin')
z = zipfile.ZipFile('2.zip', 'w')
os.chdir('./xlsx')
for root, dirs, files in os.walk('./'):
        for file in files:
            z.write(os.path.join(root, file))
z.close()
#clean
os.chdir(PAD)
rmtree('./xlsm/')
rmtree('./xlsx/')
os.remove('./2.xlsx')
os.rename('2.zip', '2.xlsm')
Attachments
No attachments
Info
Description
Please wait, i will check it soon.
on March 18th, 2020 (2:59 pm)
Description
ok
on March 18th, 2020 (11:32 pm)
Description
Send Governance_Tracker - Copy - Copy.xlsm, test.CSV, Governance_Tracker - Copy - Copy446548945.xlsx for debugging.
on April 10th, 2020 (11:23 pm)
Description
Sorry, it's not up to date.
on April 13th, 2020 (9:48 pm)
All coments
This job has not been commented yet.