How to load images from df if name missing file extensions?

I’m attempting the dog breed identification kaggle challenge. You are given a csv which has a column of id’s and a column of breed. The id corresponds to a file name, except the id is missing the file extension(e.g., ‘.jpg’). All the files are in a single folder.

I tried this:

il = (ImageList.from_df(df, ‘./input/train’, cols=‘id’) .split_by_rand_pct())

but running ‘il’ returns an error saying ‘no such file or directory’ because the file path it tries is missing the extension. What can I do here other than changing the csv contents or changing the filenames?

Edit: I think I figured it out, I used suffix=’.jpg’ in the from_df function and it loaded

You got it.

suffix
contains an optional suffix to add to the filenames in csv_labels (such as ‘.jpg’).

One time I wrote a python function to rename files to .jpg before I realized this suffix param existed.