Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- __author__ = 'structur'
- #!/usr/bin/env python
- """
- Makes a bar graph out of imported lists of stock tuples
- """
- # import numpy as np
- # import matplotlib.pyplot as plt
- from mining import *
- import json
- import datetime
- with open('/Users/curtismccord/PycharmProjects/assignment_3/data/GOOG.json', 'r') as stock_reader:
- stock_json = stock_reader.read
- stock_results = json.loads(stock_json)
- # Import jsons and functions OR function results OR the classes...
- six_best_months = mining.six_best_months(stock_results)
- six_worst_months = mining.six_worst_months(stock_results)
- six_best_months = [('2007/12', 693.76), ('2007/11', 676.55), ('2007/10', 637.38), ('2008/01', 599.42),
- ('2008/05', 576.29), ('2008/06', 555.34)]
- six_worst_months = [('2004/08', 104.66), ('2004/09', 116.38), ('2004/10', 164.52), ('2004/11', 177.09),
- ('2004/12', 181.01), ('2005/03', 181.18)]
- best_stock_prices = []
- best_stock_dates = []
- worst_stock_prices = []
- worst_stock_dates = []
- def sort_best_results(stock_results):
- for datum in stock_results:
- best_stock_dates.append(datum[0])
- best_stock_prices.append(datum[1])
- print(best_stock_prices)
- print(best_stock_dates)
- def sort_worst_results(stock_results):
- for datum in stock_results:
- worst_stock_dates.append(datum[0])
- worst_stock_prices.append(datum[1])
- print(worst_stock_prices)
- print(worst_stock_dates)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement