Double the length of a python numpy array with interpolated new values
Question: I have an array of 5 numbers:

    
    
    A = [10, 20, 40, 80, 110]
    

I need to create a new array with a 10nth length numbers.

The extra numbers could be the average number between the two # of `A`.

for example: EDIT B = [10 , 15 , 20 ,30, 40, 60, 80, 95, 110 ]

Is it possible using a scipy or numpy function ?


Answer: Using [this answer](http://stackoverflow.com/a/5347492/1258041):

    
    
    In [1]: import numpy as np
    
    In [2]: a = np.array([10, 20, 40, 80, 110])
    
    In [3]: b = a[:-1] + np.diff(a)/2
    
    In [4]: c = np.empty(2 * a.size -1)
    
    In [5]: c[::2] = a
    
    In [6]: c[1::2] = b
    
    In [7]: c
    Out[7]: array([  10.,   15.,   20.,   30.,   40.,   60.,   80.,   95.,  110.])
    

