# ---
# jupyter:
#   jupytext:
#     text_representation:
#       extension: .py
#       format_name: light
#       format_version: '1.5'
#       jupytext_version: 1.14.4
#   kernelspec:
#     display_name: Python 3
#     language: python
#     name: python3
# ---

# +
#Agenda
#What is Mapping?
#Use Mapping in DataFrames
# -

import pandas as pd
from pandas import DataFrame

df= DataFrame({
    'country': ['USA', 'China', 'Japan', 'Germany', 'India'],
    'GDP': [19,12,4,3,2]
})
print(df)

population_map= {
    'USA' : 325,
    'China': 1421,
    'Japan': 127,
    'Germany': 82,
    'India': 1338
}
print(population_map)

df['Population']= df['country'].map(population_map)
print(df)

StarcoderdataJupyterScriptsDedupFiltered