我在数据帧上使用concat两次后出现意外行为,如下所示:
import dask.dataframe as dd
import pandas as pd
ddf1 = dd.from_pandas(pd.DataFrame({'A': range(10), 'B': [1,3,5,7,9,11,13,15,17,19]}), npartitions=4)
ddf2 = dd.from_pandas(pd.DataFrame({'A': range(10), 'B': range(10)}), npartitions=4)
ddf3 = dd.from_pandas(pd.DataFrame({'A': range(10), 'B': range(10)}), npartitions=4)
cc1 = dd.concat([ddf1, ddf2], interleave_partitions=True)
cc1.compute()
# all is fine!
cc2 = dd.concat([cc1, ddf3], interleave_partitions=True)
cc2.compute()
# KeyError: 'Cannot get left slice bound for non-unique label: 0'
# CancelledError : ('concat-indexed-8c92ebf8ac1bab2c09ee51c1da6ef22d', 0)
我做错了什么或者这是一个必须报告的错误?