0

I have a pd df with 4 columns (street, state, city, zip code) and 100+ addresses. I want to be able to iterate and pass on each row & 4 columns to the function, until it can loop through all the 100+ rows. Any advice on how to do so?

# get api response
search_results_response = search_results(zwsid=zwsid,
                                rapid_api_key=rapid_api_key, 
                                street=addr.iloc[0][0], 
                                city=addr.iloc[0][1], 
                                state=addr.iloc[0][2], 
                                zipcode=addr.iloc[0][3])

# transform xml response to df
df = parse_search_results(response_content = search_results_response)
df
James
  • 3
  • 3
  • 3
    Does this answer your question? [How to iterate over rows in a DataFrame in Pandas](https://stackoverflow.com/questions/16476924/how-to-iterate-over-rows-in-a-dataframe-in-pandas) – Mady Daby Apr 24 '21 at 22:43
  • Possibly try [iloc](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.iloc.html?highlight=iloc#pandas.DataFrame.iloc) – Tytrox Apr 24 '21 at 23:02

0 Answers0