【问题标题】:Currency in Pandas Styler (rs)Pandas Styler 中的货币 (rs)
【发布时间】:2021-05-14 12:31:48
【问题描述】:

想要熊猫风格的货币:卢比 \u20B9 (How to print currency symbol and an n-digit decimal number right aligned in Python)

format_dict = {'Premium Per Rep':'{0:,.0f}'}
f1=f.style.background_gradient().format(format_dict)

但是,获得以下(适用于 $)

【问题讨论】:

    标签: python pandas dataframe data-science pandas-styles


    【解决方案1】:

    需要正确定义格式规范:

    df.style.format('\u20B9{:,.0f}')
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-03-30
      • 2016-05-03
      • 1970-01-01
      • 2019-02-23
      • 1970-01-01
      • 2012-01-22
      • 2014-08-01
      • 2021-04-26
      相关资源
      最近更新 更多