I have a pandas dataframe that looks like this:
I want to take the log of each value in the dataframe.
So that seemed like no problem at first, and then:
data.apply(lambda x:math.log(x)) returned a type error (cannot convert series to class 'float').
Okay, fine--so, while type checking is often frowned upon, I gave it a shot (also tried casting x to a float, same problem):
isinstance((data['A1BG'][0]), np.float64) returns true, so I tried:
data.apply(lambda x: math.log(x) if isinstance(x, np.float64) else x). That ran without any errors, but it didn't change any values in my dataframe.
What am I doing wrong?
Thanks!

data = data.set_index("Hybridization REF")