from math import pi, sqrt, exp

def gauss(n=11, sigma=1):
    r = list(range(-int(n / 2), int(n / 2) + 1))
return [(1 / (sigma * sqrt(2 * pi)) * exp(-float(x) ** 2 / (2 * sigma ** 2)
    )) for x in r]
Creating Gaussian filter of required length in python