trying to get the concept crystallized in my head.
say, you have a dataframe , and one of the columns is 'JobTitle'.
i'm practicing apply
, apply(lambda..., etc.
here is what i get:
try 1:
sal['JobTitle'].str.upper()
-> this works
try 2:
sal['JobTitle'].apply(str.upper())
-> this does NOT work
try 3:
sal['JobTitle'].apply(lambda title: title.upper())
-> this works
- i'm just trying to understand when it's appropriate to use
apply
vslambda
vs neither. - why does 'try 2' not work? i guess, broadly, i'm trying to understand when to use apply with or without lambda.
thank you.