autoregressive moving average code implementation
I dont know in Python, but this simple matlab/octave loop code:

function y=arma(x,A,B)
na=length(A);
n=length(x);
y(1:na,1)=zeros(na,1);
for i=na:n
    y(i,1)=1/A(1)*A(2:na)*y(i-1:-1:i-na+1)+1/A(1)*B*x(i:-1:i-na+1);
end


Implements a ARMA filter, with polynomials $A$, $B$, such as per this 5th order filter:

A=[1 0 0 0 0 0];
B=[0 0.2 0.2 0.2 0.2 0.2];
n=1000; dt=0.001; 
t=dt*(0:n-1)';
x=randn(n,1);
y=arma(x,A,B);
plot(t,[x y]);