Decimal class rounding in Pandas

前端 未结 3 1011
小鲜肉
小鲜肉 2021-01-23 16:04

i have problems rounding Decimals() inside a Pandas Dataframe. The round() method does not work and using quantize() neither. I\'ve search

3条回答
  •  醉梦人生
    2021-01-23 16:18

    Since pandas has no quantize method i used the following to solve the problem:

    out.applymap(lambda x: x.quantize(dc.Decimal('1.00')))
    

提交回复
热议问题