How can you create a new table with a Python script that uses two existing tables as input? For example by performing a left join using pandas merge?
left join
You can create a Blank Query and replace its contents in Advanced Editor:
let Source = Python.Execute("# Python:#(lf)",[df1=Table1, df2=Table2]) in Source
After you can click on the gear by the Source to add your python code where you can use df1 and df2.