Convolution Filter Python Lambda If Statement