pandas中dateframe中float类型数据默认以科学计数法显示,很难看,
可以在pd.set_option设置display.float_format参数来以政策小数显示,比如下面设置显示到小数点后3位
pd.set_option('display.float_format', lambda x: '%.3f' % x)
set_option中还有其它一些控制设置,包括默认显示列数,行数等等
pd.set_option('display.max_columns',5, 'display.max_rows', 100)
网友评论