Jun-24-2022, 09:49 PM
It will be like this,don't need to pass int as df.query only take string and then evaluate it to right type.
import pandas as pd df = pd.read_excel("book.xlsx") ser = input("Provide age: ") df_val = df.query(f"id=={ser}")['Name'] print(df_val.values[0])