fast.py 文件源码

python
阅读 57 收藏 0 点赞 0 评论 0

项目:gtable 作者: guillemborrell 项目源码 文件源码
def apply_mask_column(data, index, mask):
    """
    Sieve picks a mask over data and returns the filtered data array and index
    """
    new_data = data[mask]
    new_index = np.empty_like(index)

    data_cursor = 0
    for i, idx in enumerate(index):
        if idx:
            if mask[data_cursor]:
                new_index[i] = 1
            else:
                new_index[i] = 0
            data_cursor += 1
        else:
            new_index[i] = 0

    return new_data, new_index
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号