Question: ` ` ` [ ] import requests import pandas as pd import statsmodels.api as sm import matplotlib.pyplot as plt ` ` ` PART 1 Create
import requests
import pandas as pd
import statsmodels.api as sm
import matplotlib.pyplot as plt
PART
Create a function, wbDF that takes a world bank indicator, a county, and a time frame and returns a dataFrame with the retrieved data.
To make this useful for later, make sure:
There is a column with the year
There is a column with the country this will be constant for now, but will be useful when combinding many such dataFrames
The column with the data is named specific to indicator
Use the following to test your function
df wbDFindicatorSLTLFCACT.FEZS country"USA", startyear endyear
## Here are a few WB indicators, and thier descriptions
indicatordict
SLTLFCACT.FEZS: FLF #Female Labor Force Participation Rate
NYGDPMKTPCD: GDP #GDP duh
SPDYNCBRTIN: 'BirthRate', #birth rate
Start coding or generate with AI
Now create a function buildCountryData that takes a single country and date range and a list of indicators, returning a single dataFrame with columns for each indicator. Use the wbDF as a building block ie just merge the dataframes you created above.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
