Hi I want to pass a variable to pandas query function, however when I do this I get an error. Any idea what I am doing incorrectly?
for example
df = pd.DataFrame({"model" : ["svm"], "rmse" : [0.36], "mae" : [0.28]})
df.query('model == "svm"')[
# this works fine but when I do this,
model_name = "svm"
df.query(f'model == {model_name}')
# >>> UndefinedVariableError: name 'svm' is not defined
# i have also tries with `.format()` method which gives the same error
df.query(f'model == "{model_name}"')