In [3]:
import os
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn
In [4]:
%matplotlib inline
In [5]:
font = {'family' : 'monospace',
'weight' : 'bold',
'size' : 14}
plt.rc('font', **font)
plt.rc('figure', figsize=(18, 6))
In [6]:
os.chdir('../datasets/open-supermarkets/')
In [8]:
supermarkets = pd.read_csv('GeoLytixOpenSupermarketLocationsSept2015v6.txt', sep='\t')
In [9]:
supermarkets.head()
Out[9]:
In [28]:
vc = supermarkets['Retailer'].value_counts()[:10] # keep the top-10
idx = np.arange(len(vc.index))
plt.bar(
idx, vc.values, tick_label=vc.index, align='center'
)
Out[28]:
In [24]:
from ipywidgets import HTML
HTML('<iframe width="100%" height="520" frameborder="0" '
'src="https://additionplus.cartodb.com/viz/cf091c2c-d4f0-11e5-a5e6-0ef24382571b/embed_map" '
'allowfullscreen webkitallowfullscreen mozallowfullscreen oallowfullscreen msallowfullscreen legend'
'></iframe>')
In [40]:
labour_market = pd.read_csv('regional_labour_market_li02_2016-01.csv').dropna()
In [42]:
labour_market.head()
Out[42]:
Join on town
In [46]:
joined = supermarkets.merge(labour_market, left_on='Town', right_on='region', how='outer')
In [51]:
labour_market[labour_market['region'] == 'Hatfield']
Out[51]: