Copy for test set

Screen Link:

My Code:

        train = df[df["fold"] != fold]
        test = df[df["fold"] == fold].copy()

Why the test set use copy() function but train does not?

2 Likes

Hello @newmahone07,
I’ve not done that mission, but I think they’ve used .copy() to avoid SettingWithCopyWarning
Check here:

1 Like