Skip to content

Commit

Permalink
Merge pull request #148 from Sword-holder/master
Browse files Browse the repository at this point in the history
Fix solution of question 76.
  • Loading branch information
rougier authored Apr 26, 2021
2 parents 3135668 + 86e24f1 commit 22f47a6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion source/exercises100.ktx
Original file line number Diff line number Diff line change
Expand Up @@ -1041,7 +1041,7 @@ from numpy.lib import stride_tricks

def rolling(a, window):
shape = (a.size - window + 1, window)
strides = (a.itemsize, a.itemsize)
strides = (a.strides[0], a.strides[0])
return stride_tricks.as_strided(a, shape=shape, strides=strides)
Z = rolling(np.arange(10), 3)
print(Z)
Expand Down

0 comments on commit 22f47a6

Please sign in to comment.