I have a list of files stored in my Data folder. I can get list_of_files
:
list_of_files = glob.glob(r'C:\Users\Desktop\Data\*.csv')
I want to use pandas to read the last modified file on one specific date, say 05/31/2021. On 05/31/2021, there might be more than one files modified, and I need the last modified one latest_file
, then import to python script like this:
df = pd.read_csv(latest_file, usecols=['A', 'B', 'C'])
How can I realize it? Many thanks
(Any solution for the previous part would be great. It would be even better if you can make the modified date be last day of a certain month, like 04/30/2021, 05/31/2021, 6/30/2021 etc.)