【问题标题】:How to add new column in my test_set datafram?如何在我的 test_set 数据框中添加新列?
【发布时间】:2022-09-29 19:44:27
【问题描述】:

如何将true_prediction 变量添加到测试数据中

test[\'prediction\'] = true_prediction

但它没有作为新列添加,如myresult_pic所示

如何使测试数据接受它作为新列!

  • 此行的输出是什么:print(type(test))

标签: python deep-learning data-science data-analysis


【解决方案1】:

难道“测试”不是数据框吗?

尝试:

test = pd.DataFrame(test)
test['prediction'] = true_prediction

【讨论】:

    猜你喜欢
    • 2019-08-12
    • 2017-03-30
    • 1970-01-01
    • 2021-07-09
    • 1970-01-01
    • 2022-12-18
    • 1970-01-01
    • 1970-01-01
    • 2017-08-05
    相关资源
    最近更新 更多