def select_stars(df, bins, column_name):
    """
    Select groups of stars, based on bins.

    Args:
        df (pandas.DataFrame): a pandas dataframe.
        bins (array): The list or array of bin edges.
        column_name (str): The name of the column to cut on.

    Returns:
        ms (list): a list of masks to select stars with.

    """

    ms = []
    for i in range(len(bins)-1):
        m = (df["{}".format(column_name)] > bins[i]) * \
            (df["{}".format(column_name)] < bins[i+1])
        ms.append(m)

    return ms