title: Pandas: iterate through a list to match values in a dataframe
body: <p>I'm working with a dataframe of covid counts for all counties in the US. I've figured out how to isolate one county and export the result to a csv like this:</p>
  <pre><code>import pandas as pd
  covid = pd.read_csv('https://raw.githubusercontent.com/nytimes/covid-19-data/master/us-counties.csv')
  agh = covid[covid['county'] == 'Allegheny']
  agh.to_csv('AlleghenyCovid.csv')
  </code></pre>
  <p>Now I want to create a list of counties like this:</p>
  <pre><code>countyList = covid.county.unique()
  </code></pre>
  <p>and loop through them to create a csv for each. That's where I'm stuck. How can I use a list of known values to iterate through the dataframe and create new dataframes from each iteration? I've been thinking something like:</p>
  <pre><code>for i in countyList:
      if covid['county'] == i:
          ...
  </code></pre>
  <p>but that gives an ambiguous value error. I'm not sure exactly what needs to be defined.</p>