Re: Find slope of function given empirical data.

2010-06-30 Thread Grant Edwards
On 2010-06-29, Thomas wrote: > Trying to find slope of function using numpy. Getting close, but > results are a bit off. Hope someone out here can help. > > import numpy as np > > def deriv(y): > x = list(range(len(y))) > x.reverse() # Change from [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10] >

Re: Find slope of function given empirical data.

2010-06-30 Thread Thomas
On Jun 30, 3:28 am, Peter Otten <__pete...@web.de> wrote: > Thomas wrote: > > Trying to find slope of function using numpy. > > Getting close, but results are a bit off. Hope someone out here can > > help. > > You don't make it easy to understand your post. In the future please try to > rely more o

Re: Find slope of function given empirical data.

2010-06-30 Thread Peter Otten
Thomas wrote: > Trying to find slope of function using numpy. > Getting close, but results are a bit off. Hope someone out here can > help. You don't make it easy to understand your post. In the future please try to rely more on plain english than on lots of numbers and code that doesn't run.

Re: Find slope of function given empirical data.

2010-06-29 Thread duncan smith
Thomas wrote: Hello all. Trying to find slope of function using numpy. Getting close, but results are a bit off. Hope someone out here can help. [snip] Why are you generating y-coordinates from the x-coordinates [-6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4]? If you're going to use the x-coordina

Find slope of function given empirical data.

2010-06-29 Thread Thomas
Hello all. Trying to find slope of function using numpy. Getting close, but results are a bit off. Hope someone out here can help. import numpy as np def deriv(y): x = list(range(len(y))) x.reverse() # Change from [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10] x = np.array(x) #to [