2

When I use pandas dataframe to excel, the border of the header will be generated automatically. When I use styleframe to excel, the border of the whole table will be generated automatically. I can not use pandas.io.formats.excel.header_style = None to remove the border of dataframe and styleframe.

pandas.io.formats.excel.header_style = None

DeepSpace
  • 78,697
  • 11
  • 109
  • 154
Trinidad
  • 211
  • 2
  • 14
  • 1
    Try creating the StyleFrame object with the following default style: `sf = StyleFrame(..., Styler(border_type=None, fill_pattern_type=None))` this will mimic the "default" Excel borders – DeepSpace Sep 14 '19 at 14:42
  • Possible duplicate of [Is it possible to set the border to be the default Excel faint grey using StyleFrame?](https://stackoverflow.com/questions/57487186/is-it-possible-to-set-the-border-to-be-the-default-excel-faint-grey-using-stylef) – DeepSpace Sep 16 '19 at 07:19
  • I also want to know how to remove the border of Pandas dataframe, not just styleframe. – Trinidad Sep 17 '19 at 08:02

1 Answers1

0

Try this.

import pandas.io.formats.style

pandas.io.formats.excel.ExcelFormatter.header_style= None
Carlost
  • 478
  • 5
  • 13