Skip to content

Instantly share code, notes, and snippets.

@tshev
Created May 25, 2014 12:37
Show Gist options
  • Save tshev/49c4e783159b7ba72c57 to your computer and use it in GitHub Desktop.
Save tshev/49c4e783159b7ba72c57 to your computer and use it in GitHub Desktop.
Calculate polynomial at point
import numpy as np
# P(x) = 3x^2 + 6x + 1
np.polyval([9, 6, 1], 0) # returns 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment