This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import pandas as pd | |
import matplotlib.pyplot as plt | |
def get_bls_key(): | |
""" | |
This method will get the BLS API key that is expected in api-key.txt file. That file is in the .gitignore and | |
each user should have their own API key |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import arrow | |
import pprint | |
import matplotlib.pyplot as plt | |
import matplotlib.dates as mdates | |
import requests | |
from matplotlib.axes import Axes | |
def get_bls_key(): | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
df['date_info'] = pd.to_datetime(df['year'] + ' ' + df['periodName'], format="%Y %B") | |
df['num_of_employees'] = pd.to_numeric(df['value']) | |
df = df.drop('footnotes', 1) | |
df = df.drop('period', 1) | |
df = df.drop('periodName', 1) | |
df = df.drop('value', 1) | |
df = df.drop('year', 1) | |
df.plot(x='date_info', y='num_of_employees') |
NewerOlder