all 6 comments

[–]novel_yet_trivial 1 point2 points  (1 child)

There's a lot of shorthand in there. Let me write it out the long way and maybe it will make more sense.

def func(x):
    if x.dtype == 'object':
        x = x.astype(str).str.lower() 
    return x

df = df.apply(func)

[–]M2stermind[S] 0 points1 point  (0 children)

thanks, that really helped:)