I am using portable python 2.7.6.1 and I want to import a query from an oracle database into python pandas. I have searched a couple of examples and came up with the following code:
from sqlalchemy import create_engine
import pandas as pd
engine = create_engine('oracle://user:pass@host:port/schema', echo=False)
df = pd.read_sql('select * from databasetable', engine, index_col = index)
print df.describe()
The program stops at the 'pd.read_sql'-statement with this Error Message:
AttributeError: 'module' object has no attribute 'read_sql'
The Database connection is working and according to the examples this code should work. Can anyone help?
create_engine
also for your sql statement, does it work if you pass a raw string:df = pd.read_sql(r'select * from databasetable', engine, index_col = index)