Reputation: 3
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.
Upvotes: 0
Views: 110
Reputation: 15478
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.Upvotes: 1