Skip to content

Instantly share code, notes, and snippets.

View ejmurray's full-sized avatar

Ernest Murray ejmurray

  • Leeds, UK
  • 11:42 (UTC -12:00)
View GitHub Profile
@ejmurray
ejmurray / testmax.py
Created February 26, 2015 08:22
largest of two numbers
#!/usr/bin/python
# encoding: utf-8
"""
"""
__author__ = 'Ernest'
def maximum(num1, num2):
"""
#!/usr/bin/python
# encoding: utf-8
"""
Description
"""
__author__ = 'Ernest'
__projectName__ = 'untitled'
__date__ = '27/02/15'
__time__ = '18:20'
#!/usr/bin/python
#!/usr/bin/python
# encoding: utf-8
"""
Description: reverse text
"""
#
# def reverse(text):
# word = []
# rev_word = ''
#!/usr/bin/python
# encoding: utf-8
"""
"""
__author__ = 'Ernest'
import pandas as pd
import numpy
import matplotlib.pyplot as plt
#!/usr/bin/python
# encoding: utf-8
"""
script to plot mass over time.
"""
import pylab as pl
import numpy as np
# x = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
# y = [87.6, 86.9, 86.7, 87.2, 86.4, 86.0, 85.6, 86.0, 85.8, 85.5]
#!/usr/bin/python
# encoding: utf-8
"""
script to plot mass over time.
"""
import pylab as pl
import numpy as np
x = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
y = [87.6, 86.9, 86.7, 87.2, 86.4, 86.0, 85.6, 86.0, 85.8, 85.5]
#!/usr/bin/python
# encoding: utf-8
"""
Description
"""
import urllib2
from bs4 import BeautifulSoup
soup = BeautifulSoup(urllib2.urlopen('http://www.bcsfootball.org').read())
#!/usr/bin/python
# encoding: utf-8
"""
"""
__author__ = 'Ernest'
def anti_vowel(text):
@ejmurray
ejmurray / filerename.py
Created April 2, 2015 14:30
Rename files using python os command
__author__ = 'Ernest'
import os
for textfiles in os.listdir("."):
if textfiles.startswith("P") and textfiles.endswith('.txt'):
os.rename(textfiles, textfiles.replace("P", "p", 1))
__author__ = 'Ernest'
# Material from chapter 2 of Introduction to python
# to save a session from the console in ipython use the following
# command - %save my_session 1-20
# where %save is teh save command, my_session is the file name
# and 1-20 are the lines that you want to save.
# this data has been added to github as a new repo
# and this line
letters = 'abcdefghijklmnopqrstuvwxyz'