From c7eebf345477e342a8c3071719e276e9357ee94b Mon Sep 17 00:00:00 2001 From: Daisuke Oyama Date: Thu, 28 Aug 2014 15:07:37 +0900 Subject: [PATCH] Fixed indexing in illustrates_lln.py --- examples/illustrates_lln.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/examples/illustrates_lln.py b/examples/illustrates_lln.py index 88ab2d813..6d37660be 100644 --- a/examples/illustrates_lln.py +++ b/examples/illustrates_lln.py @@ -42,8 +42,8 @@ # == Compute sample mean at each n == # sample_mean = np.empty(n) - for i in range(1,n): - sample_mean[i] = np.mean(data[:i]) + for i in range(n): + sample_mean[i] = np.mean(data[:i+1]) # == Plot == # ax.plot(list(range(n)), data, 'o', color='grey', alpha=0.5) @@ -55,6 +55,3 @@ ax.legend(**legend_args) plt.show() - - -