Python Forum
remove b due to conversion in PyQ
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
remove b due to conversion in PyQ
#8
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)
Reply


Messages In This Thread
remove b due to conversion in PyQ - by Creepy - Jul-15-2021, 08:14 PM
RE: remove b due to conversion in PyQ - by Creepy - Jul-16-2021, 04:57 PM
RE: remove b due to conversion in PyQ - by Creepy - Jul-16-2021, 07:19 PM
RE: remove b due to conversion in PyQ - by Creepy - Jul-20-2021, 06:54 PM
RE: remove b due to conversion in PyQ - by deanhystad - Jul-20-2021, 08:30 PM
RE: remove b due to conversion in PyQ - by Creepy - Jul-21-2021, 05:57 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020