gi2xl/utils/xlsx_utils.py
def tidy_df(df, columns_to_keep=None):
    """
    Removes useless columns and tidies the dataframe.

    Args:
        df (pd.DataFrame): data frame to tidy.
        columns_to_keep (list): list of column names to keep, will remove all
            others.

    Returns:
        pd.DataFrame: tidied data frame.
    """

    if columns_to_keep is None:
        columns_to_keep = [
            "html_url", "number", "title", "created_at", "updated_at",
            "closed_at", "body", "labels"
        ]

    columns_to_drop = [col for col in df.columns if col not in columns_to_keep]

    if "labels" in columns_to_keep:
        df.labels = df.labels.apply(lambda x: get_label_name_from_dict(x))

    return df.drop(columns_to_drop, axis=1)

    Removes useless columns and tidies the dataframe.

    Args:
        df (pd.DataFrame): data frame to tidy.
        columns_to_keep (list): list of column names to keep, will remove all
            others.

    Returns:
        pd.DataFrame: tidied data frame.
    
Removes useless columns and tidies the dataframe.
Removes useless columns and tidies the dataframe .
def tidy_df(df, columns_to_keep=None):
    if columns_to_keep is None:
        columns_to_keep = [
            "html_url", "number", "title", "created_at", "updated_at",
            "closed_at", "body", "labels"
        ]
    columns_to_drop = [col for col in df.columns if col not in columns_to_keep]
    if "labels" in columns_to_keep:
        df.labels = df.labels.apply(lambda x: get_label_name_from_dict(x))
    return df.drop(columns_to_drop, axis=1)
def tidy_df ( df , columns_to_keep = None ) : if columns_to_keep is None : columns_to_keep = [ "html_url" , "number" , "title" , "created_at" , "updated_at" , "closed_at" , "body" , "labels" ] columns_to_drop = [ col for col in df . columns if col not in columns_to_keep ] if "labels" in columns_to_keep : df . labels = df . labels . apply ( lambda x : get_label_name_from_dict ( x ) ) return df . drop ( columns_to_drop , axis = 1 )
Removes useless columns and tidies the dataframe.
Removes useless columns and tidies the dataframe .
"""
    Removes useless columns and tidies the dataframe.

    Args:
        df (pd.DataFrame): data frame to tidy.
        columns_to_keep (list): list of column names to keep, will remove all
            others.

    Returns:
        pd.DataFrame: tidied data frame.
    """
tidied data frame.
tidied data frame .
pd.DataFrame
df
data frame to tidy.
data frame to tidy .
columns_to_keep
list of column names to keep, will remove all
others.
list of column names to keep will remove all others .