i have some question. I want to change one value in a column. Is there any diff in output between this two examples?
wards.loc[wards['ward'] == '1', ['ward']] = '61'
&
wards.loc[wards['ward'] == '1'] = '61'
Thanks for replies.
Yes, there is difference.
ward column as a dataframe where the criteria has matched.[] then it will get a series.ward is the only column in dataframe.
wards['ward'] = wards['ward'].replace('1', '61')This is simpler in my opinion, but they are just about the same amount of characters, and I think a direct replace would be more performant.