Why does python's scipy.signal.dimpulse introduce delay in impulse response? Consider a simple linear, time invariant system of the form:

$y_k = cy_{k-1} + (1-c)x_k$

The impulse response of this system can be computed by either dimpulse or by applying lfilter to a vector composed of a one followed by zeros:

import scipy.signal as sp_signal
import numpy as np

Ts = 1
c = 0.9
A = [1, -c]
B = [1-c]
time, imp_resp1 = sp_signal.dimpulse((B, A, Ts))
x = np.zeros(100)
x[0] = 1
imp_resp2 = sp_signal.lfilter(B, A, x)
print(imp_resp1[0][:5,0])
print(imp_resp2[:5])


which yields:

array([ 0.    ,  0.1   ,  0.09  ,  0.081 ,  0.0729])

[ 0.1      0.09     0.081    0.0729   0.06561]


Why does dimpulse introduce a one-sample delay in the impulse response?
In lfilter the transfer function is described in decreasing powers of z, as shown below copied from the python doc for signal.lfilter:

                    -1              -M
         b[0] + b[1]z  + ... + b[M] z 
Y(z) = -------------------------------- X(z)
                    -1              -N
         a[0] + a[1]z  + ... + a[N] z


While the parameters B and A in dimpulse are represented in increasing powers of z as described in the doc for signal.TransferFunction:


  If (numerator, denominator) is passed in for *system, coefficients for
  both the numerator and denominator should be specified in descending
  exponent order (e.g. s^2 + 3s + 5 or z^2 + 3z + 5 would be represented
  as [1, 3, 5])


Along with the following example given for:

$$\frac{z^2+3z+3}{z^2+2z+1}$$

Contruct the transfer function with a sampling time of 0.1 seconds:

H(z)=z2+3z+3z2+2z+1 
H(z)=z2+3z+3z2+2z+1

&gt;&gt;&gt;&gt;signal.TransferFunction(num, den, dt=0.1) 
TransferFunctionDiscrete( 
array([ 1.,  3.,  3.]), 
array([ 1.,  2.,  1.]), 
dt: 0.1 
)


So in your case, for dimpulse:

$$H_1(z)=\frac{1-0.9z^{-1}}{0.1}$$

And for lfilter:

$$H_2(z)=\frac{z-0.9}{0.1}$$

So 

$$H_1(z)= H_2(z)z^{-1}$$

And mystery solved!