I had a question on Pg. 8 of the “Data Cleaning Basics” Mission.
On the page, it says: “This method splits each string on the whitespace; the result is a series containing individual Python lists. Also note that we used parentheses to method chain over multiple lines, which makes our code easier to read.”
I did my code with and without the parentheses, and I get the same result. I don’t understand how using the parentheses helps? Can someone explain this?
laptops.loc[:,"gpu_manufacturer"] = laptops.loc[:,"gpu"].str.split().str
laptops.loc[:,'cpu_manufacturer'] = laptops.loc[:,'cpu'].str.split().str