我有一个包含 10 列的“some.xlsb”文件,其中 2 列是DateTime
列。
当我使用 pandas 加载时,日期时间列以不同的形式解析。
说明:
其中DateTime
值对应于4/10/2021 11:50:24 AM
- 读作44296.5
下面是我试过的代码。
goods_df = pd.read_excel('some.xlsb',
engine='pyxlsb', sheet_name='goods_df')
goods_df_header = goods_df.iloc[1]
goods_df.columns = goods_df_header #set the header row as the df header
goods_df= goods_df[2:]
goods_df.head(2)