Skip to content

Instantly share code, notes, and snippets.

View tugloo1's full-sized avatar

Piyush Gupta tugloo1

View GitHub Profile
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
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():
"""
@tugloo1
tugloo1 / .py
Created January 19, 2018 00:34
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')