-1

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)
desertnaut
  • 57,590
  • 26
  • 140
  • 166

1 Answers1

2

I think you just want to use np.log2 instead of np.log.

AKX
  • 152,115
  • 15
  • 115
  • 172