aliyun / aliyun-odps-python-sdk

ODPS Python SDK and data analysis framework
http://pyodps.readthedocs.io
Apache License 2.0
434 stars 97 forks source link

如何把execute_sql的结果转换为dataframe #31

Closed gaorongchao closed 7 years ago

qinxuye commented 7 years ago

0.7.3 及以后的版本可以 reader.to_pandas()

with o.execute_sql('select * from dual').open_reader() as reader:
    pd_df = reader.to_pandas()

要再转成 PyODPS DataFrame,初始化即可:

from odps.df import DataFrame

df = DataFrame(pd_df)
gaorongchao commented 7 years ago

试了一下,可以的,非常感谢!可以更新一下文档

qinxuye commented 7 years ago

OK,这块文档确实漏了