Skip to content

Instantly share code, notes, and snippets.

@jefersondaniel
Created August 20, 2019 22:11
Show Gist options
  • Save jefersondaniel/790062c02dcc55a7b0c3bfecc140be46 to your computer and use it in GitHub Desktop.
Save jefersondaniel/790062c02dcc55a7b0c3bfecc140be46 to your computer and use it in GitHub Desktop.
Notebook Helpers
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