我正在使用WRDS库通过Spyder连接到WRDS数据库。我导入wrds。根据WRDS网站,查询应该是这样的:result = wrds.sql('select * from dataset', 'variable')
但是,我得到了这个错误:AttributeError: module 'wrds' has no attribute 'sql'
发布于 2017-10-27 18:05:15
你把你的python脚本命名为'wrds.py‘了吗?这可能解释了为什么python找不到.sql。
在我的例子中,以下是可行的:
import wrds
db = wrds.Connection()
libraries = db.list_libraries()
library = 'compg'
tables = db.list_tables(library=library)
table = 'g_company'
result = db.raw_sql('select * from COMPG.G_COMPANY')https://stackoverflow.com/questions/40668215
复制相似问题