Import standard libaries


In [ ]:
import numpy as np
import pandas as pd
import datetime
import bokeh

todays_date = datetime.datetime.now().date()
index = pd.date_range((todays_date - datetime.timedelta(10)), periods=10, freq='D')

Import a reasonably tidy data set


In [16]:
raw_data = pd.read_csv('data.csv')
raw_columns = list(raw_data)

columns = set()
dates = list()

for column in raw_columns:
    if column[0:8] == "Unnamed:":
        del raw_data[column]
    else:
        columns.add(column.split(" ")[0])

Create a list of securities


In [17]:
columns = list(columns)
print(columns)


['SCEJESS', 'SX5E', 'RXA', 'FTSEMIB', 'SX7E', 'UKX', 'SXXP', 'DAX']

Create a list of dates


In [22]:
print(index)


DatetimeIndex(['2017-01-10', '2017-01-11', '2017-01-12', '2017-01-13',
               '2017-01-14', '2017-01-15', '2017-01-16', '2017-01-17',
               '2017-01-18', '2017-01-19'],
              dtype='datetime64[ns]', freq='D')

Re-organize the data into a coherent block


In [ ]: