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
worddict = set() | |
with open ('words.txt') as fh: | |
lines = fh.readlines() | |
for element in lines: | |
words = element.rstrip() | |
worddict.add(words) | |
print '{0} words in spelling words'.format(len(worddict)) | |
with open ('3-2_example.txt') as ex: |
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
year_input = raw_input('Please enter a 4-digit year: ') | |
mylist = [] | |
with open('F-F_Research_Data_Factors_daily.txt') as fh: | |
lines = fh.readlines() | |
slicedline = lines[6:-2] | |
header = lines[5].split() | |
for element in slicedline: | |
yearstr.mkt.smb.hml.rf = element.split() |
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
outerdic = {} | |
with open('F-F_Research_Data_Factors_daily.txt') as fh: | |
lines = fh.readlines() | |
slicedline = lines[6:-2] | |
header = lines[5].split() | |
for element in slicedline: | |
date = element.split()[0][:6] | |
outerdic[date] = outerdic.setdefault(date, []) | |
outerdic[date].append(float(element.split()[1])) |
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 os | |
import sys | |
import re | |
import hashlib | |
import csv | |
import time | |
import locale | |
import getopt | |