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
# Build Russell 3000 List | |
# Import libraries | |
import urllib.request | |
import datetime | |
# Download Russell 3000 to local repository | |
f_path = "/Russell3000/Membership Lists/" | |
f_name = f_path + "Russell3000 " + datetime.date.today().strftime("(%b %d, %Y)") + ".pdf" | |
def download_file(url): |
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
# Choose Ticker Universe (example: Run russell3000.py) | |
exec(open("russell3000(v.1.0).py").read()) | |
# Import Libraries | |
import datetime as dt | |
import pandas_datareader as web | |
import multiprocessing as multi | |
import numpy as np | |
import math |
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
# Text Analyzer | |
# Import text & break up into words | |
raw_text = open('test.txt').read().lower() | |
# Clean up special words: replacing false sentence stop from exception words | |
def cleanup_special_words(text): | |
# Since sentences ussually end with a [.?!], we need to create a dictionary of | |
# exception words that contain these characters | |
exceptions = {'u.s.':'u*s*', |
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
# Question 3 | |
# Import the libraries | |
import numpy as np | |
import pandas as pd | |
# Recreate the dataset function | |
def recreate_dataset(set_size, conversion_ratios): | |
import random | |