bitmapviz.py 文件源码

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

项目:tsbitmaps 作者: binhmop 项目源码 文件源码
def create_bitmap_grid(bitmap, n, num_bins, level_size):
    """
    Arranges a time-series bitmap into a 2-D grid for heatmap visualization
    """
    assert num_bins % n == 0, 'num_bins has to be a multiple of n'
    m = num_bins // n

    row_count = int(math.pow(m, level_size))
    col_count = int(math.pow(n, level_size))

    grid = np.full((row_count, col_count), 0.0)

    for feat, count in bitmap.items():
        i, j = symbols2index(m, n, feat)
        grid[i, j] = count
    return grid
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号