【问题标题】:tsFresh - The given column for the id is not present in the datatsFresh - 给定的 id 列在数据中不存在
【发布时间】:2019-06-23 10:40:52
【问题描述】:

属性错误如何解决:

The given column for the id is not present in the data 

column_id 是作为 tsfresh“extract_features”函数输入的 pandas 数据帧中的“ID”时?

【问题讨论】:

    标签: python tsfresh


    【解决方案1】:

    问题是IDMultiIndex 的级别,所以需要先通过reset_index 将所有级别转换为列:

    df = df.reset_index()
    

    【讨论】:

    • 我添加了这一行,请问如何解决这个错误'无法插入level_0,已经存在'
    • print (df.info()) 是什么?
    • MultiIndex:506 个条目,(11, 003d25e3fac5a1d2aa4ba502ffb77b5b, F, 67, SINGAPOREAN, 24/05/17, LIFE1, 67) 到 (13, ff575837be18088c0d64ae00a0228621, M, 38, SINGAPOREAN, 16/05/17, LIFE1,HIV, 38) 数据列(共 62 列): 白蛋白 506 non-null float64 Alkaline Phosphatase 506 non-null float64
    猜你喜欢
    • 1970-01-01
    • 2017-10-06
    • 2023-03-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-04-09
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多