src/wai_data_tools/read_excel.py
def stack_rows_from_dataframe_dictionary(dataframe_dict: Dict[str, pd.DataFrame]) -> pd.DataFrame:
    """
    Stacks the rows from dataframes in a dictionary to one single dataframe.
    The dictionary key will be added as an extra row to the dataframe.
    Typically used for the content from excel/google sheets documents with multiple sheets.
    :param dataframe_dict: Dictionary with dataframes.
    :return: Dataframe with rows stacked from all dataframes in dictionary
    """

    logging.info("Merging all rows from dataframes in dictionary to one dataframe")
    merged_dataframe = pd.DataFrame()
    for sheet_name, sheet_content in dataframe_dict.items():
        # Column for the sheet the data was in the file is added for traceability
        sheet_content["folder"] = sheet_name
        merged_dataframe = pd.concat([merged_dataframe, sheet_content])
    return merged_dataframe

    Stacks the rows from dataframes in a dictionary to one single dataframe.
    The dictionary key will be added as an extra row to the dataframe.
    Typically used for the content from excel/google sheets documents with multiple sheets.
    :param dataframe_dict: Dictionary with dataframes.
    :return: Dataframe with rows stacked from all dataframes in dictionary
    
Stacks the rows from dataframes in a dictionary to one single dataframe.
The dictionary key will be added as an extra row to the dataframe.
Typically used for the content from excel/google sheets documents with multiple sheets.
Stacks the rows from dataframes in a dictionary to one single dataframe . The dictionary key will be added as an extra row to the dataframe . Typically used for the content from excel / google sheets documents with multiple sheets .
def stack_rows_from_dataframe_dictionary(dataframe_dict: Dict[str, pd.DataFrame]) -> pd.DataFrame:
    logging.info("Merging all rows from dataframes in dictionary to one dataframe")
    merged_dataframe = pd.DataFrame()
    for sheet_name, sheet_content in dataframe_dict.items():
        sheet_content["folder"] = sheet_name
        merged_dataframe = pd.concat([merged_dataframe, sheet_content])
    return merged_dataframe
def stack_rows_from_dataframe_dictionary ( dataframe_dict : Dict [ str , pd . DataFrame ] ) -> pd . DataFrame : logging . info ( "Merging all rows from dataframes in dictionary to one dataframe" ) merged_dataframe = pd . DataFrame ( ) for sheet_name , sheet_content in dataframe_dict . items ( ) : sheet_content [ "folder" ] = sheet_name merged_dataframe = pd . concat ( [ merged_dataframe , sheet_content ] ) return merged_dataframe
Stacks the rows from dataframes in a dictionary to one single dataframe.
Stacks the rows from dataframes in a dictionary to one single dataframe .
"""
    Stacks the rows from dataframes in a dictionary to one single dataframe.
    The dictionary key will be added as an extra row to the dataframe.
    Typically used for the content from excel/google sheets documents with multiple sheets.
    :param dataframe_dict: Dictionary with dataframes.
    :return: Dataframe with rows stacked from all dataframes in dictionary
    """ # Column for the sheet the data was in the file is added for traceability
Dataframe with rows stacked from all dataframes in dictionary
Dataframe with rows stacked from all dataframes in dictionary
dataframe_dict
Dict[str, pd.DataFrame]
Dictionary with dataframes.
Dictionary with dataframes .