Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/date/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 3.x 如何解决操作错误:near";(";:sqldf python中的语法错误?_Python 3.x_Sqldf_Lead - Fatal编程技术网

Python 3.x 如何解决操作错误:near";(";:sqldf python中的语法错误?

Python 3.x 如何解决操作错误:near";(";:sqldf python中的语法错误?,python-3.x,sqldf,lead,Python 3.x,Sqldf,Lead,我正在熊猫数据框上运行一个简单的查询: l="""select LEAD(quarter_num,1) OVER (ORDER BY col1 , col2, col3) AS next from df""" out=ps.sqldf(l, locals()) Error:OperationalError: near "(": syntax error 是否Lead函数在sqldf中不受支持。我想在python中执行sql代码,因此必须限制自己使用sqldf和Lead 有什么帮助吗

我正在熊猫数据框上运行一个简单的查询:

l="""select LEAD(quarter_num,1) OVER (ORDER BY col1 , col2, col3) AS next from df"""
out=ps.sqldf(l, locals())

Error:OperationalError: near "(": syntax error 
是否
Lead
函数在
sqldf
中不受支持。我想在python中执行sql代码,因此必须限制自己使用sqldf和Lead

有什么帮助吗