3
我想根據一組索引鍵獲取Dask數據幀的行的子集。 (具體來說,我想查找其索引不在ddf2索引中的ddf1行)。Dask:通過索引從Dataframe中刪除(或丟棄)行
cache.drop([overlap_list])
和diff = cache[should_keep_bool_array]
都會拋出NotImplementedException,否則不起作用。
這樣做的最好方法是什麼?
我想根據一組索引鍵獲取Dask數據幀的行的子集。 (具體來說,我想查找其索引不在ddf2索引中的ddf1行)。Dask:通過索引從Dataframe中刪除(或丟棄)行
cache.drop([overlap_list])
和diff = cache[should_keep_bool_array]
都會拋出NotImplementedException,否則不起作用。
這樣做的最好方法是什麼?
我不知道這是「最好」的方式,但在這裏就是我最後做它:
pd.DataFrame(index=overlap_list)
)另一種可能性是:
df_index = df.reset_index()
df_index = df_index.dorp_dplicates()
dask中的索引操作的功能相當有限。例如,['Index.difference'](https://pandas.pydata.org/pandas-docs/stable/generated/pandas.Index.difference.html#pandas.Index.difference)將是直接的實現,但它的也沒有實施。 –