繁体   English   中英

使用 function dask.dataframe.read_sql_table 将多个列名作为输入传递给参数 index_col 以创建一个 dask Z6A8064B5DF479455500553C47C55057

[英]Pass multiple column names as input to the parameter index_col using the function dask.dataframe.read_sql_table to create a dask dataframe

有了这个我得到ValueError

import dask as dd 
data1 = dd.read_sql_table('TABLE', connection_string, index_col = ['DATE','ITEM'],schema= 'CRE') gives me a value error --> ValueError: Use label when passing an SQLAlchemy instance as the index

当我只使用如下所示的日期时,我可以将数据提取到dask dataframe

data1 = dd.read_sql_table('TABLE', connection_string, index_col ='DATE',schema= 'CRE') 

我的猜测是 dd.read_sql_table 需要一个索引列来拆分数据。 理想情况下,该列在您的 SQL 数据库中建立索引,以便于分区/分片。

将数据读入 Dask dataframe 后,您可以对其进行其他操作。 但是,请注意,截至 2020-06-27 Dask dataframe 不支持多索引。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM