title: How to iterate through two dataframes create new one?
body: <p>I'm working with the Asana Python API to pull a list of tasks and stories, which are returned as dictionary objects. There is a 1:many relationship between tasks and stories. I want to create a dataframe which has each story as one record, but with the addition of the parent task gid (unique identifier). This will let me join tasks and stories to build my report.</p>
  <p>I've created a nested loop which allows me to retrieve and print the stories associated with each task id. But rather than print the records, what I want is to build a new dataframe where each row has the parent task ID and one associated story. Nothing I've tried so far can produce that.</p>
  <pre><code># get dictionary with all tasks associated with project &amp; load into df
  tasks = client.tasks.find_by_project(&quot;project id&quot;)
  tasksDF = pd.DataFrame.from_dict(tasks, orient='columns')
  
  # iterate through task list and retrieve all associated stories
  for ind in tasksDF.index:
      print(tasksDF['gid'][ind])
      storiesDF = pd.DataFrame.from_dict(client.stories.find_by_task(tasksDF['gid'][ind]))
      for story in storiesDF.index:
          print(storiesDF)
  </code></pre>
  <p>Edit: here is the format of the first input dataframe tasksDF:</p>
  <pre><code>   gid               name
  0  1202691502803495  Improve emails  for qualification,  post-order...
  1  1202691502803501  Focus on adopt-expand  suggestions  on website 
  2  1202691502803507  Amplify  community member voices
  </code></pre>
  <p>Here is the format of the second input dataframe storiesDF:</p>
  <pre><code>   gid               created_at                       resource_type
  0  1202691619765536  2022-07-29T19:22:59.755Z         story
  1  1202691619854442  2022-07-29T19:23:06.663Z         story
  2  1202691619974673  2022-07-29T19:23:11.636Z         story
  3  1202691516738152  2022-07-29T19:24:09.938Z         story
  </code></pre>
  <p>So each record in tasksDF is the parent to one or more stories in storiesDF. I want to create a new dataframe which is the same as storiesDF, but with the addition of a column containing the matching parent gid from tasksDF.</p>
  <p>When I print using the code above, I get the elements I want (parent gid followed by multiple stories) but I can't figure out how to combine to build the dataframe I want.</p>
  <pre><code>1202691502803501
                  gid                created_at resource_type
  0  1202691619231667  2022-07-29T19:22:37.677Z         story
  1  1202691568061156  2022-07-29T19:22:49.486Z         story
  2  1202691516700419  2022-07-29T19:24:02.564Z         story
  3  1202824731913557  2022-08-18T22:20:03.991Z         story
  </code></pre>