I am using the WRDS library to connect to the WRDS databases through Spyder. I import wrds
. According to the WRDS website, a query should look like this: result = wrds.sql('select * from dataset', 'variable')
However, I get this error: AttributeError: module 'wrds' has no attribute 'sql'
Did you name your python script 'wrds.py'? This may explain why python does not find the .sql.
In my case the following works:
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')
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.