dask阵列上的GroupBy

2024-10-08 19:29:26 发布

您现在位置:Python中文网/ 问答频道 /正文

为了发现dask,我正在实现一个K-Means算法。 为了更新方法,我想使用groupBy,但是我必须转换我的磁盘阵列变成一个数据帧,然后回到磁盘阵列地址:

def update(X, Label):
    '''Update the means by using the labels computed by assign'''
    Y = X.to_dask_dataframe()
    return Y.groupby(Label.to_dask_dataframe()).mean().values

有没有办法不经过改造就做到这一点?你知道吗


Tags: theto数据方法算法dataframeby地址

热门问题