Skip to content

Instantly share code, notes, and snippets.

View wesleybowman's full-sized avatar
👨‍🚒

Wesley Bowman wesleybowman

👨‍🚒
View GitHub Profile
# coding: utf-8
# In[1]:
# thanks to commandlineluser for this bit of code and the reasoning behind it
# https://www.reddit.com/user/commandlineluser
import requests
from lxml import html
@wesleybowman
wesleybowman / pokemon.py
Created July 25, 2014 19:15
Pokemon Text Based Adventure
import time
import random
enemyPokemon = ["Oddish","Caterpie","Pidgey"]
choosenPokemon = random.choice(enemyPokemon)
print ("A wild " + choosenPokemon + " appeared!")
time.sleep(2)
print ("Go Charmander!")
time.sleep(2)
import numpy as np
import matplotlib.pyplot as plt
import math
n=1
x = np.arange(1,51) #creates all the x's
y = np.array([]) #creates an empty array for y's
for step in x: #loops through x
a = abs(np.sin(n)) #gets the sin and gets rid of negatives
@wesleybowman
wesleybowman / stemandleaf.py
Last active December 22, 2015 20:39
Given data , plots stem and left plot.
import numpy as np
from math import *
import scipy.stats as stat
def stemleafpairs(data, Round=True, stempos= 0, leafwidth=1):
"""
X - data array
stempos - position of last digit of stem,
from decimal point.
@wesleybowman
wesleybowman / findMostRecent.py
Created August 8, 2013 19:12
Most recent files.
import glob
import os.path
import time
files = glob.glob('/directory/your/want/*') #make sure you change this, I test it with just '*'
test = glob.glob('*')
for i in test:
modified = time.ctime(os.path.getmtime(i))
print('Filename: {0} \nFile Last Modified: {1}' .format(i,modified))