I have an ascii file as following (a sample)
id lon lat val1 val2 val3
1 22 38 67 66 87 89
2 23.5 39 56 10 90 98
3 22.5 38.5 34 45 56 78
For specific points (lat,lon) I want to set to zero the variables val1, val2,val3. e.g. for lon=22, lat=38 and lon=23.5,lat=39
i tried the following (only for val1 modification) and I got ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all(). How I could do that (setting also to 0 all the variables val)
import pandas as pd
col_names=['id','lon','lat','val1','val2','val3']
df = pd.read_csv(i,sep='\s+',names=col_names,header=None)
df.loc[df['Lon'] ==22 and df['Lat'] ==38, 'val1'] = 0