How can i convert the following code to log base 2?
df["col1"] = df["Target"].map(lambda i: np.log(i) if i > 0 else 0)
I think you just want to use np.log2 instead of np.log.
np.log2
np.log