import pandas as pd
from sqlalchemy import create_engine
engine = create_engine('your_database_connection_string')
query = '''
SELECT * FROM telecom.contract
'''
result_proxy = engine.execute(query)
result_set = result_proxy.fetchall()
contract = pd.DataFrame(result_set, columns=result_proxy.keys())
print(contract)
Пример ошибки:
query = '''
SELECT * FROM telecom.contract
'''
contract = pd.io.sql.read _sql(query, con = engine)
Эта ошибка:
AttributeError: 'Engine' object has no attribute 'cursor'