Skip to content

Commit c7eebf3

Browse files
committed
Fixed indexing in illustrates_lln.py
1 parent 01080dd commit c7eebf3

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

examples/illustrates_lln.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@
4242

4343
# == Compute sample mean at each n == #
4444
sample_mean = np.empty(n)
45-
for i in range(1,n):
46-
sample_mean[i] = np.mean(data[:i])
45+
for i in range(n):
46+
sample_mean[i] = np.mean(data[:i+1])
4747

4848
# == Plot == #
4949
ax.plot(list(range(n)), data, 'o', color='grey', alpha=0.5)
@@ -55,6 +55,3 @@
5555
ax.legend(**legend_args)
5656

5757
plt.show()
58-
59-
60-

0 commit comments

Comments
 (0)