{mentor edit: image of code removed}
I really don’t know where my mistake is coming from can someone help.
I get this error and do not get the expected result. Unfortunately I didn’t save the initial task to start over again.
{mentor edit: image of code removed}
I really don’t know where my mistake is coming from can someone help.
Please do not post your code on the forum. That is not allowed by the Code of Conduct.
I have edited your message to remove the code.
Hopefully a mentor for this course will stop by with some guidance.
hi @AhmedJoshuaHassan!
This message you have in the screenshot is not an error, it’s a warning.
Pandas issues this warning to alert you to a potential issue where you think you are modifying the original DataFrame, but you might actually be modifying a temporary copy that will be discarded. This can lead to your changes not being applied to your data as intended.
How to fix it:
The warning itself provides the solution: “Try using .loc[row_indexer, col_indexer] = value instead”.
.loc
ensures that you are explicitly selecting a specific location in the DataFrame and that the assignment will happen directly on the original DataFrame, preventing the ambiguity of whether you’re working with a view or a copy.
Now, check your code again, because probably the mistake you have lies in there.
You can refresh the lab following the instructions here under the “Coursera Jupyter Lab Environment” section.
Issue has been resolved. Thank you.