Structured data Rossmann notebook: invalid value encountered in log

I’m adapting Rossmann notebook (lesson 3/4) to use with my own data. I’m having an error message on this line:
df, y, nas, mapper = proc_df(joined_samp, ‘Gain_loss’, do_scale=True)
yl = np.log(y)

Error message comes from second line:
ipykernel_launcher.py:4: RuntimeWarning: invalid value encountered in log after removing the cwd from sys.path.

My Gain_loss data is going from -0.8 to +0.8, so it appears the negative values are causing a problem with the log. How can I go around this ? It’s really important for me to know if thg prediction is negative (loss) or positive (gain).

The reason the log is used for the price data is that we want to turn “multiplicative” errors into “additive” errors. What I mean by that is: In the scoring of the kaggle competition, if you think that a $50k house is actually worth $100k, that is exactly as bad as thinking that a $100k house is worth $200k, even though the additive error is $50k in the first case and $100k in the second case.
Depending on how your own input data looks like, you might not need any such massaging. Just skip the entire step of taking the log, and see what that does for you (in that case, also skip the subsequent exponentiating when computing the rmse).

Thanks Clemens, makes sense, i will go without the log.
I will report here if ever that causes problem down the line.