0
votes

Cannot see online and therefore not sure if this is possible? Can I make a query to sql that will compare columns in sql to existing pandas dataframe ?

something like that

pd.read_sql(f""" SELECT * FROM sql_dataset WHERE sql.columnA = pdDataFrame """ )
1
yes you can friendorinol, but for that you will need to convert your read_sql statement to a pandas df - INGl0R1AM0R1
This would need a little more detail, but you absolutely can do this. If you provide some sample code we can probably help get you a more exact answer - ArchAngelPwn

1 Answers

0
votes

Try this:

q = "SELECT * FROM sql_dataset WHERE sql.columnA in (" + pdDataFrame.columns + ")"
df = pd.read_sql(q)