格式化 pandas 中的数字

Cy *_* Bu 3 pandas python-3.5

对于 pandas.DataFrame: df

     min           max          mean
a    0.0  2.300000e+04  6.450098e+02
b    0.0  1.370000e+05  1.651754e+03
c  218.0  1.221550e+10  3.975262e+07
d    1.0  5.060000e+03  2.727708e+02
e    0.0  6.400000e+05  6.560047e+03
Run Code Online (Sandbox Code Playgroud)

我想格式化显示,例如以“:,.2f”格式显示的数字(即##,###.##)并删除指数。

我尝试过:df.style.format("{:,.2f}")这给出了:<pandas.io.formats.style.Styler object at 0x108b86f60>我不知道该怎么办。请问有什么线索吗?

ℕʘʘ*_*ḆḽḘ 5

试试这个年轻的熊猫学徒

pd.options.display.float_format = '{:,.2f}'.format
Run Code Online (Sandbox Code Playgroud)