在Excel文件中填充日期的格式爲mm/dd/yyyy
格式。從Excel導入日期時如何在Python中保留格式(mm/dd/yyyy)
我輸入列到名單在Python使用此代碼:
first_excel_file = pd.read_excel('test.xlsx')
item_end_date = first_excel_file['Item End Date'].values.tolist()
但我得到這個:
[1478476800000000000, 1476921600000000000, 1488240000000000000, 1488240000000000000, 1488240000000000000, 1488326400000000000, 1489622400000000000, 1489622400000000000, 1489968000000000000, 1494288000000000000, 1454198400000000000, 1454198400000000000, 1490918400000000000, 1490918400000000000, 1490918400000000000, 1491955200000000000, 1491955200000000000, 1446249600000000000, 1509408000000000000, 1509408000000000000, 1509408000000000000, 1364688000000000000, 1391126400000000000, 1398816000000000000, 1422662400000000000, 1418428800000000000, 1419292800000000000, 1422662400000000000, 1422662400000000000, 1422662400000000000, 1423612800000000000, 1426291200000000000, 1438300800000000000]
如何導入這些日期並保持其原始格式,而不是領這些數值?
這將幫助,如果你表現出你目前正在使用加載該文件中的代碼,並指定文件格式是什麼。 (Excel接受很多不同的格式。) –
請注意,excel中顯示的日期格式與csv一樣很少與文件格式相匹配。它是一個實際的Excel文件格式還是在Excel中打開的不同格式? – roganjosh
@roganjosh它是一個實際的excel文件,有人創建 –