I have 2 CSV files which look something like these
SiteID Price
A12 33
B98 48
SiteID Price
B57 100
A12 33.5
what I am trying to do is from CSV1 look for A12 in CSV2 and if present compare the price with upto 10% difference. I tried doing this with pandas but not getting the right results. If not pandas then any other way of doing this in Python? Here is my sample code
ab = df.loc[df['SiteID'] =='A12',['price']]
co = 33
if co>=ab-ab*0.1 and co<= ab+ab*0.1:
print("Value is correct")
this leads to ValueError: The truth value of a DataFrame is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all()
merge. What is your expected output?