Skip to content

Instantly share code, notes, and snippets.

View chtmorris's full-sized avatar

Charlie Morris chtmorris

View GitHub Profile

Keybase proof

I hereby claim:

  • I am chtmorris on github.
  • I am chtmorris (https://keybase.io/chtmorris) on keybase.
  • I have a public key ASAIRAIlv87UgA7CL-szvuD8Co-IVRqcqsqkC0yCmty20go

To claim this, I am signing this object:

0x005b661B34Cb13E4023A26048eB6440a9e1d611B
@chtmorris
chtmorris / Lesson2homework.py
Created March 11, 2015 08:09
Lesson 2 homework
# Import required libraries
from __future__ import division
import sys
import csv
# Start a counter and store the textfile in memory
lines = sys.stdin.readlines()
lines.pop(0)
# Get max_age to determine number of lines needed
@chtmorris
chtmorris / identityMatrix.py
Last active August 29, 2015 14:16
Identity Matrix
import numpy as np
def identityMatrix(rows):
'''
Create an empty matrix list
Append new rows of 0s to the list, with the number of elements dependent on the number of rows
Substitute a 1 for a 0 in the place of matrix[x][x]
Use numpy to pretify it
@chtmorris
chtmorris / gist:e7a281b5e4792a9d8388
Last active May 1, 2021 23:42
Classwork matrix and vector multiplication
import numpy as np
# Define matrix and vector
vector = [1, 2, 3, 4]
matrix = [ [1, 2, 3, 4],
[5, 6, 7, 8],
[9, 0, 1, 2] ]
# Function 1
def vectorMatrixMultiplication(matrix,vector):