我正在尝试编写可以将数据帧(df)和column(col)作为输入并将column中的编码HEX转换为ascii的函数。
我已经尝试过,"7061756c".decode("hex")但是我不确定我可以在col列中申请全部记录,以下是我尝试过的代码
def hex_to_ascii(df , col):
for i in range(0,len(df['col'].values)):
string = bytearray.fromhex(df['col'].values[i]).decode()
Run Code Online (Sandbox Code Playgroud)
我被困在这里,有人可以帮忙吗