import numpy as np
def std_deviation(arr_x,arr_y):
    # arr_y = np.zeros((len(data)))
    # arr_x = np.zeros((len(data)))
    # for i in range(len(data)):
    #    arr_x[i] = data[i][0]
    #    arr_y[i] = data[i][1]
    mean_x = np.mean(arr_x)
    mean_y = np.mean(arr_y)
    std_x = np.std(arr_x)
    std_y = np.std(arr_y)
    print (len(arr_x), len(arr_y))
    data_filter_x = []
    data_filter_y = []

    for i in range(len(arr_x)):
        if arr_x[i] > mean_x - 1.5 * std_x and \
           arr_x[i] < mean_x + 1.5 * std_x:
            data_filter_x.append(arr_x[i])
    for i in range(len(arr_y)):
        if arr_y[i] > mean_y - 1.5 * std_y and \
           arr_y[i] < mean_y + 1.5 * std_y:
            data_filter_y.append(arr_y[i])
                # data_filter.append([arr_x[i], arr_y[i]])
    # print (data_filter_x, data_filter_y)
    print (std_x, std_y)
    print (mean_x, mean_y)
    print (len(data_filter_x), len(data_filter_y))
    # print (data_filter)
    right_eye = (np.array(data_filter_x))
    left_eye = (np.array(data_filter_y))
    print(np.std(left_eye), np.std(right_eye))
    left_mean = np.mean(left_eye)
    right_mean = np.mean(right_eye)
    print(left_mean, right_mean)
    return left_mean - right_mean
