I have an input file with two columns:
county name | id |
---|---|
"York, SC" | GHCND:USW00053871 |
I use the id column to create a list. Then I have a loop for the id to make an online weather request.
input_file = "id_in_sample.csv"
df = pd.read_csv(input_file)
list = df['id'].tolist()
Then I save the weather information along with the id as a csv file.
id | weather |
---|---|
GHCND:USW00053871 | 5 |
I am trying to collect the county name in my file as well. So that it looks like the following table.
county name | id | weather |
---|---|---|
"York, SC" | GHCND:USW00053871 | 5 |
Is there a way to do it within the loop when I make a request or should I try to merge/join once I have the csv file?