def reindex_df_so_selected_cols_are_first(df, selected_cols, raise_error=True):
    """ Reindex DataFrame so that selected columns are displayed first (on the left)

    Parameters
    ----------
    df : pandas DataFrame
        Pandas 2D DataFrame with unique columns
    selected_cols : list
        List of strings representing the column names to place first

    Returns
    -------
    df : pandas DataFrame
        Original DataFrame with altered column order
    """
    col_list_orig = list(df.columns)
    for col in selected_cols:
        if col in col_list_orig:
            col_list_orig.remove(col)
        elif raise_error == True:
            raise ValueError(
                """

Error, reindex_df_so_selected_cols_are_first, '%s' not in columns"""
                 % col)
        else:
            print(
                "\n\nError, reindex_df_so_selected_cols_are_first, '%s' not in columns"
                 % col)
    col_list_final = selected_cols + col_list_orig
    return df.reindex(columns=col_list_final)
