Created
August 20, 2019 22:11
-
-
Save jefersondaniel/790062c02dcc55a7b0c3bfecc140be46 to your computer and use it in GitHub Desktop.
Notebook Helpers
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def smooth_curve(points, factor=0.9): | |
smoothed_points = [] | |
for point in points: | |
if smoothed_points: | |
previous = smoothed_points[-1] | |
smoothed_points.append(previous * factor + point * (1 - factor)) | |
else: | |
smoothed_points.append(point) | |
return smoothed_points |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment