【发布时间】:2021-06-17 04:08:31
【问题描述】:
一般来说,Pandas 中存在许多关于抑制科学记数法的问题
- Format / Suppress Scientific Notation from Python Pandas Aggregation Results
- Suppressing scientific notation in pandas?
- How do I print entire number in Python from describe() function?
但是,它们似乎都不适用于to_markdown 函数。例如:
import pandas as pd
df = pd.DataFrame({'val': 3e10}, index=[0]) # print(df) gives 3.000000e+10
pd.set_option('float_format', '{:f}'.format) # print(df) gives 30000000000.000000
但是,df.to_markdown() 仍然产生
| | val |
|---:|------:|
| 0 | 3e+10 |
如何禁用to_markdown() 中的科学记数法?
【问题讨论】: