Excellent video. But I'm still puzzled by my case. Oversimplifying, I'm trying to do data['y'] = np.log(data['x']) This should bring no warning. The curious thing is that if I do it in a jupyter cell, I don't get a warning. However, I put this inside a function, and I get the SettingWithCopyWarning. Can you think what can be going on? To clarify, the ONLY thing that changes is that this line being inside a function or outside.
You could rewrite it to: data['y'] = data['x'].apply(lambda x: np.log(x)). This solution will not explain why are you getting that warning, but probably will get rid of the warning.
If you have a single set of square brackets and you're still seeing the warning... that's weird! Would you please post your code here? I"ll see if I can understand and help.
This was the best explanation for that warning i have ever come across. can't wait for you pandas workout book to come out.
Thanks so much!
This is by far the best explanation I've ever seen for this issue 🤩
Glad you enjoyed it, thanks for the kind words!
Best explanation I've seen so far and under 10 min! Thank you because I absolutely loathe that error.
Thanks for the kind words; I'm glad you enjoyed it! (And yeah, that error is the worst...)
Great overview Reuven and something I have fallen into a number of times when working in Pandas 😀
You're not alone! Glad to hear it helped.
Nice video, thanks Reuven! The why is just as important as the how 🙂
My pleasure!
Great video Reuven, this warning always boils my blood lol
Excellent, I'm glad that it helped!
Great explanation. This problem happens so, so often! :D
You're not alone; glad this helped!
Crystal clear explanation! Thank you very much for that!
Delighted to know you enjoyed!
Great explanation, thanks!
I'm delighted it helped!
Thank you so much, this explanation was so precise and easy to understand. It helped me a lot. Now I am a subscriber of your channel :)
Fantastic; I'm delighted to hear it helped!
This was great. Thank you!
Glad you enjoyed it!
Thank you sir!
Man, I “LOVE” you …..
Thanks so much! You have no idea how much this kind of comment means to me.
that's a good one. like always excellent explanation. thanks
Glad you enjoyed it!
Awesome, thanks man
Glad it helped!
Excellent video. But I'm still puzzled by my case. Oversimplifying, I'm trying to do
data['y'] = np.log(data['x'])
This should bring no warning. The curious thing is that if I do it in a jupyter cell, I don't get a warning. However, I put this inside a function, and I get the SettingWithCopyWarning. Can you think what can be going on? To clarify, the ONLY thing that changes is that this line being inside a function or outside.
You could rewrite it to: data['y'] = data['x'].apply(lambda x: np.log(x)). This solution will not explain why are you getting that warning, but probably will get rid of the warning.
Hmm, I'm not sure why you would be getting that, except that (maybe) the data frame is itself a view, or is sharing data with another data frame?
Best explanation for human
Glad to know it helped!
sir, you are great!
Thanks so much for the kind words!
amazing thanks
Glad you enjoyed it!
Mil gracias! Tienes un nuevo subs.
Delighted that you enjoyed it!
what if i fix it still the warning shows. what should i do?
If you have a single set of square brackets and you're still seeing the warning... that's weird! Would you please post your code here? I"ll see if I can understand and help.
@@ReuvenLerner thanks for your response. i had issue with two lines. fixed both the line and the warning finally went off.
This just does not apply to the issue si am seeing.
Sorry to hear that - I'm guessing that it's a related problem, even if not this precise one.