def read_bader(in_name):
    """
    Read charges from a Bader program output file.

    Parameters
    ----------
    in_name : str
        Name of the file to read
    Returns
    -------
    charges : list of floats
        Charges in file

    """
    with open(in_name) as bader_file:
        content_bader = bader_file.readlines()

    # electron charge per atom
    charges = []
    for line in content_bader:
        if line.split()[0].isdigit():
            charge = float(line.split()[4])
            charges.append(charge)

    return charges