I have two csv files, which have different rows in them
For example, A csv, has 2000 rows, while B csv, has 100.000 rows, and i need to check,
How could i alter the following code, for the following task?
I need to lookup, all serial numbers from the first csv, and find matches, on the second csv. The result report, will have the serial number that matched, and the corresponding product ids from each csv, in a separate column:
A = pd.DataFrame({'product id': [1455,5452,3775],
'serial number':[44,55,66]})
print (A)
B = pd.DataFrame({'product id': [7000,2000,1000],
'serial number':[44,55,77]})
print (B)
print (pd.merge(A, B, on='serial number'))
Desired output:
product id_x serial number product id_y
1455 44 7000
5452 55 2000
read_csv, you then need to perform a left type merge sopd.merge(A,B, on='serial_number', how='left')