Skip to content

Instantly share code, notes, and snippets.

@tomyoo
tomyoo / prediction.py
Last active August 29, 2015 13:58
Generates predictions based on given data.
"""
predictions.py
Author: Thomas W. Yoo
Generates predictions based on given data.
Started 4/7/2014
v0.1: Initial commit. Generates the rows with the two closest dates to aid in average calculation
v0.2: Generates the average sale amount for the two dates as a prediction.
v0.3: For holidays, figures out what the expected amount should be and how much was the actual sales.
v0.4: For holidays, predicts the sales amount based on sales behavior the last year.
Enter the department to graph or all: 5
5
Enter the store to graph or all: all
all
Store: all
Rows gotten
dept gotten
date gotten
sale gotten
Enter the department to graph or all: all
all
Enter the store to graph or all: all
all
Store: all
Rows gotten
dept gotten
date gotten
sale gotten
@tomyoo
tomyoo / scatterplots.py
Last active August 29, 2015 13:58
Uses matplotlib to create scatterplots based on the department.
"""
scatterplots.py
Author: Thomas W. Yoo
Uses matplotlib to create scatterplots based on the department.
Started 4/7/2014
v0.1: Initial commit. Had only the first mode of operation.
v0.2: Second large commit. Has three modes of operation now.
v0.3: Added flags for holiday sales
v0.4: Added capability for graphing based on temperature, gas price, CPI, and unemployment rate.
@tomyoo
tomyoo / primetest.py
Created April 2, 2014 07:20
Primality Checker
"""
primetest.py
Author: Thomas W. Yoo
Start Date: 3/31/2014
This program prompts the user for an integer and declares whether or not it is a prime number.
"""
# bisect_left to help see if a number is in a list. Used in isPrime.
from bisect import bisect_left as bsl
@tomyoo
tomyoo / DupeRemover.py
Created March 11, 2014 21:47
A data mining solution for the fact that there were many duplicate customers found in the customer relationship management database. I heavily relied on regular expressions to streamline the solution (a skill I picked up while working over the summer).
"""
DupeRemover.py
@author: Thomas W. Yoo
Start date: 7/30/2013
This program will go through the CRM customer file and remove all duplicate entries.
Algorithm description:
Names:
> If same address, append to file for manual review
@tomyoo
tomyoo / CompileFileData.py
Created March 11, 2014 21:45
Works with CreateDicts.py. These two files were unfortunately not utilized completely, but they were to be a searchable database for all the Excel documents on the company server. It would parse all documents to create a dictionary of keywords and then would use JSON to keep the data searchable in the SQL database. As it wasn't completely implem…
"""
CompileFileData.py
@author: Thomas W. Yoo
Start Date: 6/18/2013
This program will create a table entry for a given file.
Filepath, Filesize, LastModified, Filetype, and Searchable Info.
"""
import os
@tomyoo
tomyoo / CreateDicts.py
Created March 11, 2014 21:44
Works with CompileFileData.py. These two files were unfortunately not utilized completely, but they were to be a searchable database for all the Excel documents on the company server. It would parse all documents to create a dictionary of keywords and then would use JSON to keep the data searchable in the SQL database. As it wasn't completely im…
"""
CreateDicts.py
@author: Thomas W. Yoo
Start date: 6/18/2013
This program will take in an Excel spreadsheet and output an array of the words.
Except: the, a, an, but, of
"""
from xlrd import *
@tomyoo
tomyoo / wordcount.py
Last active August 29, 2015 13:57
A simple script to count a certain word in a file.
"""
wordcount.py
author: Thomas W. Yoo
date: 3/10/2014
This program takes a file and a word as input parameters and returns a count.
"""
import sys