def within_n_sds(n, series):
    """Return true if all values in sequence are within n SDs"""
    z_score = (series - series.mean()) / series.std()
    return (z_score.abs() <= n).all()
def within_n_sds ( n , series ) : z_score = ( series - series . mean ( ) ) / series . std ( ) return ( z_score . abs ( ) <= n ) . all ( )
Return true if all values in sequence are within n SDs