我使用的是PortablePython2.7.6.1,我想从oracle数据库导入一个查询到PythonPandaps。我搜索了几个示例,得出了以下代码:
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()
程序在'pd.read_sql语句'-带有此错误消息的语句:
^{pr2}$数据库连接正在工作,根据示例,此代码应该可以工作。有人能帮忙吗?在
方法^{} 在{}中引入(发布日期:2013-07-24)。在
{a2}
pandas模块从子模块导入read_sql;您可以尝试从子模块获取它:
您还可以打印
pd.__dict__
以查看pd
模块中提供了哪些内容。如果您尝试使用pd
模块中的其他内容,例如pd.Series()
,您是否会得到AttributeError
?在非常感谢。 我已经和警察局核实过了。dict和pandas文档上的版本。 >;在我的版本0.11.0中,
'sql_read_frame'
似乎是要使用的命令,在版本0.15.0中,您可以使用'read_sql'
读取sql相关问题 更多 >
编程相关推荐