def mean_squared_error(array1, array2):
    'Returns element-wise mean squared error between two arrays.'
    if (len(array1) != len(array2)):
        raise ValueError(f'array1 and array2 must be of same length ({len(array1)} != {len(array2)})')
    else:
        error = (np.asarray(array1) - np.asarray(array2))
        return np.mean(np.atleast_2d((error ** 2)), axis=1)
Returns element-wise mean squared error between two arrays.
def mean_squared_error(array1, array2):
    
    if (len(array1) != len(array2)):
        raise ValueError(f'array1 and array2 must be of same length ({len(array1)} != {len(array2)})')
    else:
        error = (np.asarray(array1) - np.asarray(array2))
        return np.mean(np.atleast_2d((error ** 2)), axis=1)