REG : Lesson 1 - Segmentation Labelling Function Code

Hi,

What do the .stem, _P, .suffix in the below code do
lambda x: path/'labels'/f'{x.stem}_P{x.suffix}' ?

Mu understanding of it :
.stem : Is used for stemming the labels
.suffix : Is used for removing the Suffixes
_P : Couldn’t get a clear idea in-spite of my search

Can anyone please correct me & explain them in detail!

Thank you!!

_P is part of the string literal and it does nothing: it is part of the output.
stem and suffix is the Path methods. Checkout the Python docs.

Hi Steve,

Thanx for the reply.