New Jobs Analysis with Python
The presidential race is heating up as primaries come to an end. And if it’s Trump vs Clinton, there’ll be no shortage of strong opinion among the electorate as to which offers the best policies for economics, defense, energy, health care, etc.
Last year I posted a series of blogs on Dataversity pertaining to the “economic” performance of presidents over the last seventy years. Part of my motivation was to have fun with my “red” neighborhood friends who claim they always outperform blue and that the Reagan era represented the height of U.S. history.
For the earlier blogs, I downloaded several spreadsheets with time series data on jobs, unemployment, and gdp from the St Louis Fed. I then constructed in R a datatable with the relevant data embellished by indicators of the president and party in power for each monthly data point. Finally, I computed and displayed summary statistics by president and party.
A few weeks back, a neighborhood kid studying python asked if I’d share the blog-supporting Jupyter notebook with him. He’d been reminded of my work when he recently found a Fact Check Article summarizing a much more comprehensive analysis than mine. His thinking was that understanding the computation behind the analytics would advance his learning of python.
Alas, my analysis had used R rather than python, so I spent an evening assembling a python notebook on some of the calculations. I then gave it to him with the assignment of finishing the “undone” R code in python. He did a great job. “Study Results?” Though blue appear to “trump” red, I conclude very little importance from these analytics. The remainder of the article oulines my evening of python work.
As for the code:
Kalyan Banga203 Posts
I am Kalyan Banga, a Post Graduate in Business Analytics from Indian Institute of Management (IIM) Calcutta, a premier management institute, ranked best B-School in Asia in FT Masters management global rankings. I have spent 6 years in field of Analytics.