I have to excel files with the following fields
file1
col1,col2,col3,col4,col5,col6,col7,col8,col9
server1,java_yes,....
server2,java_no,....
server4,java_no,....
server8,java_no,....
file2
col1,col2,col3,col4,col5,col6,col7,col8,col9
server1,java_yes,....
server3,java_no,....
server4,java_yes,....
server8,java_no,....
I want to
a. Iterate over file1
b. Compare each entry in col1 in file1 against col1 in file2
c. If it exists, I want to see if the value in file1->col2 matches the entry in file2->col2
d. If file1->col2 does not match file2->col2 then I want to update file1->col2 to equal file2->col2
Update
Running in strange issue and providing the details here.
It works fine for most of the entries but for some entries it displays NaN even though the dataframe has java_yes in both places.
To figure this out, I added a filter and then printed it at various stages.
When I print for df1, df2 and merged it works fine.
When I print the same at the very end, it displays NaN for certain entries
Very strange.
my_filter = ( df1['col1'] == 'server1' ) print(df1.loc(my_filter, 'col2')
All except the last print returns
Yes
The very last print (for df1) returns
NaN