Last active
February 1, 2017 22:01
-
-
Save NickWoodhams/f1bb126b95b6f9931e621d8650ea62f3 to your computer and use it in GitHub Desktop.
Revisions
-
NickWoodhams revised this gist
Feb 1, 2017 . 1 changed file with 32 additions and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,32 @@ #! /usr/bin/python # required library to create a matrix import numpy # random int library from random import randint from pprint import pprint # create an empty list variable to add lists into rows = [] # iterate 2000 times, varible i is the number of iteration it's currently on for i in range(2000): # create 2 random ints between 0 and 1000 r1 = randint(0, 1000) r2 = randint(0, 1000) # create a list of the two random ints rand_pair = [r1, r2] # prints the rand_pair variable to your terminal print(rand_pair) # append a 1x2 list to the rows list rows.append(rand_pair) # Creates a numpy matrix m = numpy.matrix(rows) pprint(m) -
NickWoodhams created this gist
Feb 1, 2017 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,7 @@ #! /usr/bin/python from random import randint r1 = randint(0, 1000) r2 = randint(0, 1000) print(r1, r2)