def _read_data(fname):
    """Reads data from file.

    Reads the data in 'fname' into a list where each list entry contains 
    [energy predicted, energy calculated, list of concentrations].

    Parameters
    ----------
    fname : str
        The name and path to the data file.
    
    Returns
    -------
    energy : list of lists of floats
       A list of the energies and the concentrations.
    """
    
    energy = []
    with open(fname,'r') as f:
        for line in f:
            CE = abs(float(line.strip().split()[0]))
            VASP = abs(float(line.strip().split()[1]))
            conc = [i for i in line.strip().split()[2:]]

            conc_f = []
            for c in conc:
                if '[' in c and ']' in c:
                    conc_f.append(int(c[1:-1]))
                elif '[' in c:
                    conc_f.append(int(c[1:-1]))
                elif ']' in c or ',' in c:
                    conc_f.append(int(c[:-1]))
                else:
                    conc_f.append(int(c))
            energy.append([CE, VASP, conc_f])
    return energy