【发布时间】:2018-10-19 15:55:40
【问题描述】:
【问题讨论】:
-
您要对它们进行四舍五入吗?或者只是获得完整的浮动?
-
我需要完整的浮动。但是那些突出显示的数字应该是 0。我不知道为什么 Python 会返回这些格式......
标签: python pandas math scientific-notation
【问题讨论】:
标签: python pandas math scientific-notation
选项1:您可以使用一个选项:display.precision:pd.set_option('precision', 5)
选项2:可以使用浮点格式:
pd.options.display.float_format = '${:,.5f}'.format
选项3:你可以使用圆形:
DataFrame.round(decimals=0, *args, **kwargs) to can round close to the nearest number:
df.round(5) # for whole dataframe
【讨论】: