Code Sample, a copy-pastable example if possible
import pandas as pd
L1 = [1,2,3,4,5,6,7,8,9,10]
df = pd.DataFrame({"L1":L1})
df.to_excel("test.xlsx")
Problem description
Files in Windows Explorer have three dates assigned: - Date Created - Date Accessed - Date Modified
I'm using a german Windows 10, but I'm pretty sure it's Date Accessed I'm talking about now:
Exporting a dataframe in Windows 10 using to_excel()
assigns a Date Accessed in Windows Explorer that corresponds to the moment that to_excel()
was first executed in the respective iPython console plus 2 hours.
So when I execute to_excel()
first at 10:24 the file and each subsequent file gets an initial Date Accessed value of 12:24. Resetting the console does not change that, only opening a complete new console does.
EDIT: There is no change in behaviour when a file is created at a time past the future Date Accessed.
The fields Date Created and Date Modified get the correct timestamp.
My timezone is UTC+2 (CET+1 DST), maybe that has something to do with it.
Editor: Spyder 3.2.0
Expected Output
Output of pd.show_versions()
Comment From: gfyoung
Thanks reporting this issue! While this does sound a little strange, we don't do anything fancy with timestamp-ing Excel files on our end for this to happen (I've never seen it myself as a Windows user). Thus, I think it's just Windows misbehaving there.
I will close this for now, but if I'm incorrect on this, we'll be happy to re-open.
Comment From: Khris777
Okay, no problem. Those three different dates in Windows seem to be a fickle issue in general.