This file contains hidden or 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
| # -*- coding: utf-8 -*- | |
| """ | |
| ECONEV.PY: Economic Events | |
| Python web-scraper for economic events on the Bloomberg Econoday calendar. | |
| Saves result of scrape to plain text (in Eastern Time) for flexible processing by other applications. | |
| Author: rwev (https://github.com/rwev) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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 urllib | |
| from wordpress_xmlrpc import Client, WordPressPost | |
| from wordpress_xmlrpc.methods import posts | |
| import xmlrpclib | |
| from wordpress_xmlrpc.compat import xmlrpc_client | |
| from wordpress_xmlrpc.methods import media, posts | |
| import os | |
| ########################### Read Me First ############################### | |
| ''' | |
| ------------------------------------------In DETAIL-------------------------------- |
This file contains hidden or 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 pandas as pd | |
| import pandas_datareader.data as web | |
| import numpy as np | |
| import datetime | |
| from scipy.optimize import minimize | |
| TOLERANCE = 1e-10 | |
| def _allocation_risk(weights, covariances): |
This file contains hidden or 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 pandas as pd | |
| def add_rec_bars(ax, dates=None): | |
| if dates is None: | |
| dates = pd.read_csv('/Users/tom/bin/rec_dates.csv', | |
| parse_dates=['Peak', 'Trough']) | |
| for row in dates.iterrows(): | |
| x = row[1] | |
| y1, y2 = ax.get_ylim() |