There are 2 sheets in my xlsx file. The file is stored locally. when I am printing the rows and columns,I am getting the output. what i want is if any value in first column (patient id) of "patient info" sheet matches with any value in first column (p id) of "records" sheet, then I want to append that cell value from "records" sheet to the list c and print all list of matching values.But when I am running my code, no output is generated and even there is no error or warning shown when it is run. please find the dataset attached.patients dataset
import openpyxl
import pandas as pd
filename="week_05_homework_XLSX_openpyxl.xlsx"
wb= openpyxl.load_workbook(filename)
sheet1=wb['patient info']
sheet2=wb['records']
df1= pd.DataFrame(sheet1.values)
df2= pd.DataFrame(sheet2.values)
p=len(df1.index)
q=len(df2.index)
c =[]
for i in range(2,p):
for j in range(2,q):
if df1.iloc[i,1]==df2.iloc[j,1]:
c.append((df2.iloc[j,1]))
print(c)