Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/just-cameron/misc-python. All my Python code for class or other things.
Something went wrong. Try again.
1234567891011121314151617181920import numpy as npimport pandas as pdimport urllib.request as urrimport matplotlib as plt
es_url = "https://www.stoxx.com/document/Indices/Current/HistoricalData/hbrbcpe.txt" #Fucky onevs_url = "https://www.stoxx.com/document/Indices/Current/HistoricalData/h_vstoxx.txt"
#These two commands pull the file and dump it into the named document.urr.urlretrieve(es_url, "es.txt")urr.urlretrieve(vs_url, "vs.txt")
lines = open("es.txt", 'r')lines = lines.readlines()lines = [line.replace(' ', '') for line in lines]
#turns out this data starts using a semicolon at the end of the line starting from row 3,887.es = pd.read_csv("es.txt", index_col = 0, parse_dates = True, sep = ';', dayfirst = True)