0

Can I use pd.open_csv to find the most recent CSV file in a directory with a file name beginning with "Recent_Data..."?

i.e. If the directory contained the following CSVs:

Recent_Data1a.csv

Recent_Data2bcd.csv

Recent_Datasample.csv

...and the most recent one was "Recent_Data2bcd.csv", can I get Pandas to select it somehow? Or is it better to use glob.iglob for this sort of thing?

cel
  • 30,017
  • 18
  • 97
  • 117
Dance Party
  • 3,459
  • 10
  • 42
  • 67
  • 2
    i would just use `glob` – maxymoo Nov 16 '15 at 05:36
  • Traverse over the list of files in directory find [identify latest file](http://stackoverflow.com/questions/237079/how-to-get-file-creation-modification-date-times-in-python) and open with pandas and open – WoodChopper Nov 16 '15 at 06:02

0 Answers0