Skip to content

when use to.excel() with header=False, misal position has occurred #88

@tugodxx

Description

@tugodxx

when use to.excel() with header=False, misal position has occurred

image

import pandas as pd
from styleframe import StyleFrame, Styler, utils

volume_dict = {'tag': pd.Series(['AA', 'AB', 'AC', 'AD', 'AE']),
               'value': pd.Series(['sss', 'sdsd', 10.5, 10.6, 22.0]),
               'cal': pd.Series(['', '', '=C3/C5', '=C4/C5', ''])}
volume_data_df = pd.DataFrame(volume_dict)

default_style = Styler(font_size=8)
cus_style = Styler(bg_color='#ccffff')
sf = StyleFrame(volume_data_df, styler_obj=default_style)

sf.apply_column_style(cols_to_style='tag',
                      styler_obj=cus_style,
                      overwrite_default_style=False)
sf2 = StyleFrame(volume_data_df, styler_obj=default_style)
sf2.set_column_width(columns=sf.columns, width=10)
sf2.apply_column_style(cols_to_style='tag',
                       styler_obj=cus_style,
                       overwrite_default_style=False)

ew = StyleFrame.ExcelWriter('my_excel.xlsx')
sf.to_excel(ew, sheet_name='11', startcol=1, startrow=0, header=False, index=False)
sf.to_excel(ew, sheet_name='11', startcol=5, startrow=0, header=True, index=False)

ew.save()

styleframe==3.0.5

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions