def norm_corr(x, y, mode='valid'):
 return (np.correlate(x, y, mode) / ((np.std(x) * np.std(y)) * x.shape[(-1)]))

def norm_corr ( x , y , mode = 'valid' ) : return ( np . correlate ( x , y , mode ) / ( ( np . std ( x ) * np . std ( y ) ) * x . shape [ ( - 1 ) ] ) )
returns the correlation between two ndarrays .