Is it possible to write the date modified to a file name with python? I have a large batch of .csv files where the date modified field must be converted to the file name.
Or even better write the date modified to the csv file itself as a column.
Is it possible to write the date modified to a file name with python? I have a large batch of .csv files where the date modified field must be converted to the file name.
Or even better write the date modified to the csv file itself as a column.
use to_datetime()
to convert the float value to DatatimeIndex:
from os import path
from glob import glob
pd.to_datetime([path.getmtime(fn) for fn in glob("*.*")], unit="s")