pseudo increasing the 'resolution' of a value table
Question: I have an measurement array with 16.000 entries in the form of

    
    
    [t] [value]
    

the problem is my data logger is too slow and i only have measurement points
every second. For my simulation i need the resolution pseudo increased. So
that every time step is divided by 1000 and every measured value has to be
copied a 1000 times. (see figure for clarity). So I pseudo increase the
resolution of my measurement file.

How do I do that efficiently(!!!) in `Python` using `numpy`. I dont want to
iterate when creating an array of 16.000.000 entries.![enter image description
here](http://i.stack.imgur.com/WiJmr.png)

The trivial answer of just dividing my time array by 1000 is not applicable in
this case.

Edit: to make it even more complicated: Other than in my picture the time-
delta is NOT equidistant for every timestep.


Answer: Though it's difficult to tell exactly what you're asking, I'm guessing that
you're just looking to interpolate between the values that you've already got.
Good thing `numpy` has a simple built-in for this, the `interp1d` module
([docs](http://docs.scipy.org/doc/scipy-0.15.1/reference/generated/scipy.interpolate.interp1d.html)):

    
    
    >>> from scipy import interpolate
    >>> x = np.arange(0, 10)
    >>> y = np.exp(-x / 3.0)
    >>> f = interpolate.interp1d(x, y)
    
    >>> x_new = np.array([1.5, 2.5, 3.5])
    >>> f(x_new)
    array([ 0.61497421,  0.44064828,  0.31573829])
    

As far as the second part of your question is concerned `numpy` again has a
great built-in for you! The `np.repeat` function should do exactly what you're
looking for, right up through the variable time steps. The docs can be found
[here](http://docs.scipy.org/doc/numpy/reference/generated/numpy.repeat.html).
Example below:

    
    
    >>> values = np.array([1, 2, 3, 4])
    >>> np.repeat(values, [2, 1, 2, 1])
    array([1, 1, 2, 3, 3, 4])
    

