我想在pandasql查询中使用Course Identity python变量,但是它不起作用。
这是我的代码:
Course_Identity='Mathematics'
query=("""SELECT user_id, course_id, count( DISTINCT event_type) as Sequential from big_data where event_type like '%sequential+block%' and course_id = Course_Identity group by user_id, course_id """)
Sequential = pd.DataFrame(ps.sqldf(q0_dseq, locals()))
Sequential.head()