![](/img/trans.png)
[英]df to table throw error TypeError: __init__() got multiple values for argument 'schema'
[英]While performing SQL query in python using pandas i am facing the error : TypeError: __init__() got multiple values for argument 'schema'
嘗試在 python 中編譯 sql 查詢。我曾經在 python 中經常這樣做。但我過去從未遇到過這個錯誤。 幫我解決這個問題。
詢問:
from pandasql import sqldf
import pandas as pd
from sklearn import datasets
Q10="select bucket,count(*) as COUNT,min(probability) as MINSCORE,max(probability) as MAXSCORE,(avg(probability)*100) as PREDDEFRATE,sum(response) as RESPONSE,count(*)-sum(response) as NONRESPONSE from score group by 1;"
Bucket_Details = sqldf(Q10,globals())
display(Bucket_Details)
TypeError: init () 為參數 'schema' 獲取了多個值
提前致謝。
我在使用 sqldf function 時遇到了同樣的錯誤,它發生在過去同樣有效,但它不適用於表。
安裝較早版本的 sqlalchemy。Sqlalchemy 版本 2.0.0 已於昨天發布,與 pandasql 不兼容。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.