I would like to write a def function that gives me these values when working with the dataframe. It shows amount of bikers in each country for a specific year. It is indexed by country code.
The dataframe name is df3_merged
The first 2 lines of dataframe looks like this: Columns are Country name and different years as columns.
Country Name 1960 1970 1980
Country Code
AGO Angola 500 1000 1400
ZAM Zambia 600 3304 6009
def pop_bikers(country_name, year):
#code here
return
When input is pop_bikers('Zambia', 1970) == Answer: 3304
I would just like to know how can write this def function to get the answer of 3304.
There is alot of countries and alot of years, just curious as to how one would write it in a def function.