Leave dates as strings using read_excel function from pandas in python

后端 未结 3 884
南旧
南旧 2020-12-02 00:17

Python 2.7.10
Tried pandas 0.17.1 -- function read_excel
Tried pyexcel 0.1.7 + pyexcel-xlsx 0.0.7 -- function get_records()

3条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-02 01:07

    • Using converters{'Date': str} option inside the pandas.read_excel which helps. pandas.read_excel(xlsx, sheet, converters={'Date': str})
    • you can try convert your timestamp back to the original format
      df['Date'][0].strftime('%Y/%m/%d')

提交回复
热议问题