title: Pandas Groupby from two csv files
body: <p>So I'm doing an exercise from Datacamp that tells you to aggregate life expectancy by region from two files.</p>
  <h1>life_fname with columns: ['Country', 'Life Expectancy']</h1>
  <p>Source: <a href="https://s3.amazonaws.com/assets.datacamp.com/production/course_1650/datasets/life_expectancy.csv" rel="nofollow noreferrer">https://s3.amazonaws.com/assets.datacamp.com/production/course_1650/datasets/life_expectancy.csv</a></p>
  <h1>regions_fname with columns: ['Country', 'Region']</h1>
  <p>Source:
  <a href="https://s3.amazonaws.com/assets.datacamp.com/production/course_1650/datasets/regions.csv" rel="nofollow noreferrer">https://s3.amazonaws.com/assets.datacamp.com/production/course_1650/datasets/regions.csv</a></p>
  <pre><code># Read life_fname into a DataFrame: life
  life = pd.read_csv(life_fname, index_col='Country')
  
  # Read regions_fname into a DataFrame: regions
  regions = pd.read_csv(regions_fname, index_col='Country')
  
  # Group life by regions['region']: life_by_region
  life_by_region = life.groupby(regions['region'])
  
  print(life_by_region)
  # Print the mean over the '2010' column of life_by_region
  print(life_by_region['2010'].mean())
  </code></pre>
  <p>I understand what index_col does with one dataframe but what I don't understand is how does python know to find the 'common denominator' column ['Country'] across multiple dataframes?</p>
  <p>I don't explicitly state:</p>
  <p>life['Country'] == regions['Country'].</p>