如何在pandasql中使用python变量?

时间:2019-02-28 05:59:17

标签: python-2.7 pandasql

我想在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()

0 个答案:

没有答案