Dask Series.loc对于Pandas Series.loc返回不同的结果:多个分区?

时间:2018-10-25 18:37:42

标签: python pandas dask

关于Series.loc,我正在体验Dask Pandas.loc的怪异行为。这是我目前正在使用Dask系列进行的操作,该系列具有一个时间戳作为索引,而一个float作为列值:

ddf.map_partitions([lambda data: data.loc[lambda raw_data: (raw_data.index >= start_date) & (raw_data.index <= end_date)]).compute()

Panda的Series.loc返回6个结果,而Dask的Series.loc仅返回3个结果。

Dask系列有8个分区,其创建如下:

d_series = ddf.from_pandas(p_series, npartitions=8)

设置npartitions=1时,Dask Series.loc方法将返回与Pandas Series.loc方法匹配的结果。

最初,我认为这是由start_dateend_date跨越多个分区引起的。但是,当我在2到8之间改变分区数并因此改变分区时,Dask Series.loc方法始终返回相同的错误结果。因此,我认为我的start_date / end_date与部门的不匹配不是问题所在。

有什么想法吗?

0 个答案:

没有答案