【发布时间】:2018-03-30 22:05:45
【问题描述】:
这是将 dask 数据帧的子集加载到内存的有效方法吗:
while i < len_df:
j = i + batch_size
if j > len_df:
j = len_df
subset = df.loc[i:j,'source_country_codes'].compute()
我在某处读到这可能不正确,因为 dask 如何分配索引号,因为它将较大的数据帧划分为较小的 pandas dfs。此外,我认为 dask 数据帧没有 iloc 属性。
我使用的是 0.15.2 版
就用例而言,这将是一种将批量数据加载到深度学习(比如 keras)的方式。
【问题讨论】: