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 1
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
```
df1= wbDF(indicator="SL.TLF.CACT.FE.ZS", country="USA", start_year=2000, end_year=2022)
[] ## Here are a few WB indicators, and thier descriptions
indicator_dict ={
'SL.TLF.CACT.FE.ZS': "F-LF", #Female Labor Force Participation Rate
'NY.GDP.MKTP.CD': "GDP", #GDP, duh
'SP.DYN.CBRT.IN': '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 (i.e., just merge the dataframes you created above.
` ` ` [ ] import requests import pandas as pd

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!