次の方法論を使用してを構築するpandas.DataFrame
と、(私が思うに)独特の出力が得られます。
import pandas, numpy
df = pandas.DataFrame(
numpy.random.rand(100,2), index = numpy.arange(100), columns = ['s1','s2'])
smoothed = pandas.DataFrame(
pandas.ewma(df, span = 21), index = df.index, columns = ['smooth1','smooth2'])
平滑化された値を見に行くと、次のようになります。
>>> smoothed.tail()
smooth1 smooth2
95 NaN NaN
96 NaN NaN
97 NaN NaN
98 NaN NaN
99 NaN NaN
これは、次の断片化された呼び出しの集約のようであり、異なる結果が得られます。
smoothed2 = pandas.DataFrame(pandas.ewma(df, span = 21))
smoothed2.index = df.index
smoothed2.columns = ['smooth1','smooth2']
再びDataFrame.tail()
私が得る呼び出しを使用して:
>>> smoothed2.tail()
smooth1 smooth2
95 0.496021 0.501153
96 0.506118 0.507541
97 0.516655 0.544621
98 0.520212 0.543751
99 0.518170 0.572429
なぜこれらをDataFrame構築方法論とは異なるものにする必要があるのかについて、誰かが理論的根拠を提供できますか?