gpt4 book ai didi

python - 在简单的 pandas 数据框上使用 tsfresh

转载 作者:太空宇宙 更新时间:2023-11-04 05:19:26 27 4
gpt4 key购买 nike

我正在尝试在我制作的简单 pandas 数据帧上提取特征 (tsfresh.extract_features)。每次我运行和打印特征时,我只是将每个计算出的特征作为 0 或 NaN。我已经尝试阅读了很多文档,但似乎无法理解它。

代码如下:

d = {'one':pd.Series(np.random.randn(10)),
'two':pd.Series(np.random.randn(10))}
df = pd.DataFrame(d)
print(df)
#
features = extract_features(df, column_id='one')
print(features)

感谢任何帮助。

谢谢

最佳答案

问题是您的时间序列只有一个值长,大多数特征计算器将为一个值的时间序列返回 NaN。

您可以尝试使用更长的时间序列。

在这里查看笔记本 https://github.com/blue-yonder/tsfresh/tree/master/notebooks

关于python - 在简单的 pandas 数据框上使用 tsfresh,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40795801/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com