I am trying to execute a script under 2 conditions, If both the conditions are satisfied then only further code can be executed.
Input Data: Sheet1
Name Contact_number id_number accuracy
Eric 9786543628 AZ256hy 90
Jack 9786543628 AZ98kds 85
Tom 9784533930 AZ256hc 80
Alan 9778934593 AZ256py 70
Sheet2
Name Contact_number id_number
Eric 9786543628 AZ256hy
Jack 9786543628 AZ98kds
Tom 9784533930 AZ256hc
David 9778984893 JH657lv
Expected Output:
Name Contact_number id_number
Eric 9786543628 AZ256hy
Jack 9786543628 AZ98kds
Code i have been using :
df = pd.read_excel(open(r'input.xlsx', 'rb'), sheet_name='sheet1')
df2 = pd.read_excel(open(r'input.xlsx', 'rb'), sheet_name='sheet2')
if df['id_number'] = df2['id_number'] and df['accuracy'] =>85:
df['Name'][index] = df2['Name']
df['Contact_number'][index] = df2['Contact_number']
But while using this condition the if statement is not working with AND condition. Any suggestion ?
df1["accuracy"]?