<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def within_n_std(df, n=3):
 """ Assert that every value is within ``n`` standard deviations of its column's mean. Parameters ========== df : DataFame n : int number of standard deviations from the mean Returns ======= df : DataFrame """

    means = df.mean()
    stds = df.std()
    inliers = (np.abs(df[means.index] - means) < n * stds)
    if not np.all(inliers):
        msg = generic.bad_locations(~inliers)
        raise AssertionError(msg)
    return df