Jul-20-2021, 08:30 PM
You are looking at the wrong thing. In your code the 'x' in the lambda is a column (Series). A Series is not a bytes, so nothing is replaced. I think you want to do something like this:
for col in df: df[col] = df[col].apply(lambda x: x.decode() if isinstance(x, bytes) else x)