Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/314.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 我想通过绘制去趋势时间序列的平均值和标准偏差来获得这个时间序列的季节性,我该怎么做?_Python_Statistics_Jupyter - Fatal编程技术网

Python 我想通过绘制去趋势时间序列的平均值和标准偏差来获得这个时间序列的季节性,我该怎么做?

Python 我想通过绘制去趋势时间序列的平均值和标准偏差来获得这个时间序列的季节性,我该怎么做?,python,statistics,jupyter,Python,Statistics,Jupyter,我有一个一维时间序列,看起来像一个乘法时间序列。 时间序列是一组数字: print(np.array(lsds_ref_period)) [151.62701 231.33696 196.937 244.07704 186.32698 211.21698 248.97696 216.12698 259.61502 257.77106 258.94806 321.143 272.489 285.266 268.23196 321.57 281.414 242.83699

我有一个一维时间序列,看起来像一个乘法时间序列。 时间序列是一组数字:

print(np.array(lsds_ref_period))

[151.62701 231.33696 196.937   244.07704 186.32698 211.21698 248.97696
 216.12698 259.61502 257.77106 258.94806 321.143   272.489   285.266
 268.23196 321.57    281.414   242.83699 378.07996 303.77402 409.939
 245.35199 295.19104 244.02199 317.38   ]
我通过使用以下公式减去平均值来消除趋势:

def detrend(data):
    detrend_mean_remove = signal.detrend(np.array(data), type=='constant') #removes only the mean
    return detrend_mean_remove

mean_removed_lsds_ref_period = detrend(lsds_ref_period)
现在我想画出这个时间序列的平均值和标准偏差? 我该怎么做?如果我取平均值的np.mean或np.std,去掉lsds,得到一个值。有没有办法在每一点上取平均值?。。。
这似乎不可能,因为它是一个一维数组,但我只想再次检查。

每个点的时间序列平均值是多少?什么意思?它是一个时间序列,每一点都是指某一段时间