Skip to content

Instantly share code, notes, and snippets.

@robertmaxwilliams
Last active February 28, 2018 00:36
Show Gist options
  • Save robertmaxwilliams/bd064ac303a0f6b5257cbd6f17ee3c29 to your computer and use it in GitHub Desktop.
Save robertmaxwilliams/bd064ac303a0f6b5257cbd6f17ee3c29 to your computer and use it in GitHub Desktop.
converts numbers into other numbers, good luck me in the future.
# copy filter from here and paste into stdin
# http://dev.theomader.com/gaussian-kernel-calculator/
input_string = input("paste in filter, it won't have spaces but that's okay: ")
float_filter = [float('0.'+x) for x in input_string.split('0.')][1:]
smallest = min(float_filter)
discrete_filter = [round(x/smallest) for x in float_filter]
print(discrete_filter)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment