Question on get_y_fn

I understand the output but I’m wondering where does .stem and .suffix come from. is this from fast.ai? Thanks

get_y_fn = lambda x: path_lbl/f'{x.stem}_P{x.suffix}'

from camvid : https://github.com/hiromis/notes/blob/master/Lesson3.md

1 Like

Hey @andrew77, they come from python’s pathlib library. Cheers.

2 Likes

Ok got it. Thanks

https://docs.python.org/3/library/pathlib.html?highlight=stem#pathlib.PurePath.stem

2 Likes

I think it’s from
pathlib
(https://docs.python.org/3/library/pathlib.html?highlight=stem#module-pathlib)