I'm trying to write a function with two calls, one which is the data frame and the other which is some numeric value. I get the error that name "t is not defined." When I hard code that numeric value, everything works well.
Here is minimal reproducible example.
df = pd.DataFrame([[1, 2], [1, 3], [4, 6]], columns=['A', 'B'])
def my_fun(t, df):
l = df.query('A == t')
return l
my_fun(1, df)