Open danielarmel opened 3 years ago
hi @danielarmel , have you tried by first subsetting the dataframe like this?
I have, it changes it when I write the code:
But my problem is that it doesn't "save" these changes. When I try to rename them, I get this error:
Which makes sense as the length of the list is still 8, while I try to rename only 4 columns.. I can't seem to figure out how to make the subset permanent
You will have to store the subsetted dataframe in a new variable before changing the column names :) As your code is now you only inspect the subsetted dataframe. In the following line where you try to change the column names you use the original dataframe which has 8 columns.
That fixed it, thanks!
Hi! I'm a little confused about exercise 0.4.2
We are supposed to rename the columns, but how do you only select the first four columns? I've tried iloc and loc, but that doesn't "change" the length of df_weather