Updating value in iterrow for pandas
问题 I am doing some geocoding work that I used selenium to screen scrape the x-y coordinate I need for address of a location, I imported an xls file to panda dataframe and want to use explicit loop to update the rows which do not have the x-y coordinate, like below: for index, row in rche_df.iterrows(): if isinstance(row.wgs1984_latitude, float): row = row.copy() target = row.address_chi dict_temp = geocoding(target) row.wgs1984_latitude = dict_temp['lat'] row.wgs1984_longitude = dict_temp['long'