I have a dataframe df with a column 'lon' that has values which range from 0 - 15 and 250 - 360. I would like to wrap the values around from -180 to 180 without a for loop. So, the input is this:
df['lon'] = [1,10,15,250,360]
and the output should look like this
df['new_lon'] = [1,10,15,-110,0]
This would be easy to do with a for loop, but I would like to do it without a loop. In particular, I don't how to deal with dataframe where I want the values less than 15 to stay the same but I want the values greater than 15 to be changed.