2334 days ago by hogben

import requests import tempfile from scipy.io import loadmat # Location of the matrix data file DATA_FILE = "https://orion.math.iastate.edu/lhogben/m407507proj1matrices.mat" # Temporary file to store the matrix data in tf = tempfile.TemporaryFile() loaded_mats = None try: # Stream the data into the temporary file resp = requests.get(DATA_FILE, stream=true) for chunk in resp.iter_content(): tf.write(chunk) # Load the matrices from the temporary file loaded_mats = loadmat(tf) except Exception as e: print "An error occurred" print e finally: tf.close() 
# Extract my matrices by name # !!! change 99 to your number H99 = Matrix(RDF, loaded_mats['H99']) L99 = Matrix(RDF, loaded_mats['L99'])