def read_file(filename, first_line_labels):
    """
    Read the tsv file and return the labels and the data.
    :param filename: The data file
    :type filename: str
    :param labels: Whether the first line has labels
    :type labels: bool
    :return: array and 2-D array of labels and data
    :rtype: array, array
    """

    labels = ['X', 'Y']

    x=[]
    y=[]
    with open(filename, 'r') as fin:
        if first_line_labels:
            labels = fin.readline().strip().split("\t")

        for l in fin:
            p=l.strip().split("\t")
            x.append(float(p[0]))
            y.append(float(p[1]))

    return labels, [x, y]