首页 > 解决方案 > ezhc heatmap.build 需要 pandas.core.index 但它是 Pandas.core.index 已弃用

问题描述

我使用 ezhc 和 pandas 为热图生成数据

def industry_heatmap(csv):
    df  = pd.read_csv(csv).set_index('Industry').groupby(level=0).mean()
    idx, col, data = hc.build.series_heatmap(df) …
    return idx, col, data
    return json

然而,由于 pandas 1.3.1 弃用 pandas.core.index ...

C:\Users\lib\site-packages\ezhc\build.py, line 338, in series_heatmap
    return series

def series_heatmap(df, *args, **kwargs):
    idx = df.index
    col = df.columns
    assert(isinstance(idx, pd.core.indexe.Index)) …
    for c in col:
        assert(df[c].dtype.kind in 'if')
    dft = df.copy()
    dft.index = range(len(df.index))
    dft.columns = range(len(df.columns))

我收到归因错误

module 'pandas.core' has no attribute 'index'

ezhc 为 highchart javascript 生成数据的任何解决方法或替代方法???提前致谢

标签: djangopandasheatmap

解决方案


推荐阅读