Ling Guo -4 years ago 58

Python Question

I have a x-array and a y-array (numpy, python). The y array is some function of x. The x-array is:

`x = np.array([1,4,5,7,11])`

The y array is:

`y = np.array([4,8,9,11,14])`

I want to obtain the values of y at values of x that I choose (but which are not there in the pre-existing x-array). For example, the new x-array is:

`x_new = = np.array([1,2,3,4,5,6,7,8,9,10])`

What is the best (and

Recommended for you: Get network issues from **WhatsUp Gold**. **Not end users.**

Answer Source

Well a good start would be to look at Numpy's interpolation method. Can get the job done for most situations.

Recommended from our users: **Dynamic Network Monitoring from WhatsUp Gold from IPSwitch**. ** Free Download**

Latest added