(Solved) : Task Create Script Uses Requests Library Query Propublica Api Retrieve Information Members Q42757798 . . .

The task is to create a script that uses the requests library toquery the Propublica API to retrieve information about members ofCongress, and then uses the matplotlib library to create avisualization of information calculated from the data pulled fromPropublica. Specifically, your tool should:

  1. Pull the list of members for each available Congress;
  2. Calculate their respective ages at the beginning of eachCongressional session for which there is data, currently the 102ndto the 116th Congress;
  3. Use these age figures to calculate the average age of themembers of each Congress;
  4. Plot the trend over time using matplotlib (average age bysession);
  5. As an optional bonus exercise, plot separate lines for Houseand Senate.

NOTE: For the purpose of this assignment we can use Jan. 1 ofthe year the session began to approximate the age figures. Forexample, the current Congress is the 116th, which began on2019-01-03, but for calculating ages you can use 2019-01-01.

language: Python

Expert Answer


Answer to The task is to create a script that uses the requests library to query the Propublica API to retrieve information about …

Leave a Comment

About

We are the best freelance writing portal. Looking for online writing, editing or proofreading jobs? We have plenty of writing assignments to handle.

Quick Links

Browse Solutions

Place Order

About Us