def _create_excel_file(fieldnames: List[str], row_data: List, filename: Optional[t_path]=None, percentage_cols: Optional[List[str]]=None):
    if (filename is None):
        filename = './log/montecarlo_summary.xlsx'
    file_exists = os.path.isfile(filename)
    if file_exists:
        wb = load_workbook(filename)
        ws = wb.worksheets[0]
        del ws.tables['Table1']
    else:
        wb = Workbook()
        ws = wb.worksheets[0]
        ws.append(fieldnames)
    ws.append(row_data)
    tab = Table(displayName='Table1', ref=(('A1:' + str(chr((64 + len(row_data))))) + str(ws.max_row)))
    if (percentage_cols is not None):
        for col in percentage_cols:
            ws[(col + str(ws.max_row))].number_format = '0.00%'
    ws.add_table(tab)
    wb.save(filename)
def _create_excel_file(fieldnames: List[str], row_data: List, filename: Optional[t_path]=None, percentage_cols: Optional[List[str]]=None):
    if (filename is None):
        filename = './log/montecarlo_summary.xlsx'
    file_exists = os.path.isfile(filename)
    if file_exists:
        wb = load_workbook(filename)
        ws = wb.worksheets[0]
        del ws.tables['Table1']
    else:
        wb = Workbook()
        ws = wb.worksheets[0]
        ws.append(fieldnames)
    ws.append(row_data)
    tab = Table(displayName='Table1', ref=(('A1:' + str(chr((64 + len(row_data))))) + str(ws.max_row)))
    if (percentage_cols is not None):
        for col in percentage_cols:
            ws[(col + str(ws.max_row))].number_format = '0.00%'
    ws.add_table(tab)
    wb.save(filename)