adamone

在我们处理excel表时,通过pandas读取的字段往往会以科学计数的形式显示,有时会对我们做后续的操作有一定影响,那么怎么消除显示呢 ↓

读取excel
pd.read_excel(\'*.xlsx\',converters={\'字段名1\':str,\'字段名2\':str})
这样读取的时候字段就显示全了

生成excel
data.字段.astype(str)
data.to_excel(\'*.xlsx\')
网上还有通过pd.set_option(\'display.float_format\',lambda x : \'%.2f\' % x) # 禁用科学计数法

np.set_printoptions(suppress=True)
大家也可以试试~

分类:

技术点:

相关文章:

  • 2021-11-23
  • 2022-12-23
  • 2021-11-02
  • 2022-12-23
  • 2021-12-02
  • 2021-10-20
  • 2021-07-07
  • 2021-08-23
猜你喜欢
  • 2021-11-02
  • 2021-12-12
  • 2021-11-28
  • 2021-06-03
  • 2021-09-28
  • 2021-04-03
相关资源
相似解决方案