How to set the pandas dataframe data left/right alignment?

后端 未结 6 981
礼貌的吻别
礼貌的吻别 2020-11-30 05:23

I use pd.set_option(\"display.colheader_justify\",\"right\") to set the column header. But I can\'t find the option for data by pd.describe_option()

6条回答
  •  挽巷
    挽巷 (楼主)
    2020-11-30 06:12

    you can control it by a new context:

    with pd.option_context('display.colheader_justify','right'):
        ...
    

提交回复
热议问题