import math


def standard_deviation(series):
    """
    implements the sample standard deviation of a series from scratch
    you may need a for loop and your average function
    also the function math.sqrt
    you should get the same result as calling .std() on your data
    https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.Series.std.html
    See numpy documenation for implementation details:
    https://docs.scipy.org/doc/numpy/reference/generated/numpy.std.html
    """
    pass
    avgnum = sum(series) / len(series)
    sumsq = 0
    for each in series:
        t = each - avgnum
        sumsq = sumsq + pow(t,2)
    stdnum = math.sqrt(sumsq/(len(series)-1))
    return stdnum