#NEWLINE# def apply_filter( x , filter = None , axis = 0 ) : #NEWLINE# #INDENT# 'Apply a filter to an array.' #NEWLINE# x = _as_array ( x ) #NEWLINE# if ( x . shape [ axis ] == 0 ) : #NEWLINE# #INDENT# return x #NEWLINE# #UNINDENT# ( b , a ) = filter #NEWLINE# return signal . filtfilt ( b , a , x , axis = axis )