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
# open csv file | |
file = open("X.csv") | |
fileReader = csv.reader(file) | |
# sum score | |
for row in fileReader: | |
# sum scores for rows 10 to 90 in columns 2 and 3 | |
if 8 < fileReader.line_num < 90: | |
score1 += int(row[1]) | |
score2 += int(row[2]) |
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 matplotlib.pyplot as plt | |
import shelve | |
from collections import OrderedDict | |
d = shelve.open("driverCountFriday") | |
data = d | |
print(tuple(data)) |
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 praw | |
from collections import deque | |
from time import sleep | |
from datetime import date | |
import calendar | |
import shelve | |
r = praw.Reddit("Python:SportsTeamBiasAnalyser:1.0 (by /u/lollipoppizza)") |
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 re | |
import shelve | |
def cleanup(words): # Clean up the input | |
if "s" in words: | |
words.remove("s") | |
if "is" in words: | |
words.remove("is") |