JerBouma
2/14/2019 - 3:39 PM

[Loc vs Pandas Slicing] Important fix to prevent possible errors. #Python #Pandas

[Loc vs Pandas Slicing] Important fix to prevent possible errors. #Python #Pandas

# Use:
medalslondon.loc[:,'Total'] = medalslondon['Gold'] + medalslondon['Silver'] + medalslondon['Bronze']

# Instead of:
medalslondon['Total'] = medalslondon['Gold'] + medalslondon['Silver'] + medalslondon['Bronze']