我正在按照tsfresh python程序包()的“快速入门”代码进行操作pip install tsfresh
。
from tsfresh.examples.robot_execution_failures import download_robot_execution_failures, \
load_robot_execution_failures
download_robot_execution_failures()
timeseries, y = load_robot_execution_failures()
from tsfresh import extract_features
extracted_features = extract_features(timeseries, column_id="id", column_sort="time")
import pandas as pd
extracted_features.to_csv("file.csv")
这extracted_features
是一个熊猫数据框。如图所示,id
当我将其写入csv
文件时它具有一列。
但是,当我尝试将其检索为时extracted_features[["id"]]
,会收到错误消息KeyError: "['id'] not in index"
。有没有办法解决这个问题。
如果需要,我很乐意提供更多详细信息。
可能那id
是您的索引。检查extracted_features.index
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句