In the DecisionTree exercise “Find the Flag” we are asked to extract our labels from the flags Dataframe by using:
labels = flags[[“Landmass”]]
I am aware that using the double squares brackets returns a DataFrame instead of a Pandas Series. But I am not sure whether we need the DataFrame in this case as we only want to extract a single column.
Is there an advantage to working with a DataFrame even when it is only a single column?
I would otherwise go for: labels = flags[“Landmass”]
Thanks in advance.