I have two columns that I am trying to iterate through and compare the data of the Pin column to each separate number in the Adj. column and throw a flag if they match. Row 0 Pin only has to compare with each number in row 0 Adj.. I have created a dictionary in which each number corresponds to a color, with several numbers being the same color. If the "color" in the Pin column matches the "color" in the Adj. column I want make a basic print statement. The issue that I am having is using the dictionary to compare the values.
Table
Sample Spreadsheets Being Used
import pandas as pd
excel_file = r'C:\Users\449287\Documents\Sample.adjacent.xlsx'
excel_file1 = r'C:\Users\449287\Documents\Sample.Pin.Out.xlsx'
df = pd.read_excel(excel_file, sheetname='Sheet1')
df1 = pd.read_excel(excel_file1, sheetname='Sheet1')
df1d = {1: "R",2: "O",3: "Y", 4: "GR", 5: "L", 6: "R", 7: "B", 8: "L", 9: "GR", 10: "O"}
"""
df1.set_index('Pin')['Color'].to_dict()
"""
df['Adj.'] = df['Adj.'].str.replace(',', ' ')