operation

How to multiply two columns of a Dataframe?

How to multiply two columns of a Dataframe? Question: Good afternoon, I am trying to multiply two columns of a dataframe (C). And add the results to a new column. I have tried different methods but none work. The most common error I encounter is: TypeError: can’t multiply sequence by non-int of type ‘float’ The …

Total answers: 2

byte operations (XOR) in python

byte operations (XOR) in python Question: #!/usr/bin/env python3 import binascii var=binascii.a2b_qp("hello") key=binascii.a2b_qp("supersecretkey")[:len(var)] print(binascii.b2a_qp(var)) print(binascii.b2a_qp(key)) # here I want to do an XOR operation on the bytes in var and key and place them in ‘encryption’: encryption=var XOR key print(binascii.b2a_qp(encrypted)) If someone could enlighten me on how I could accomplish this I would be very happy. …

Total answers: 3