-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplot_data.py
More file actions
35 lines (28 loc) · 986 Bytes
/
plot_data.py
File metadata and controls
35 lines (28 loc) · 986 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import shapefile
import matplotlib.pyplot as plt
import matplotlib.patches as patches
from matplotlib.patches import Polygon
from matplotlib.collections import PatchCollection
from descartes import PolygonPatch
import matplotlib
import numpy as np
import pandas as pd
import openpyxl as op
import mapDataPlot
import scrape
import analyze
# -- plot --
mapName = "./Map/england_pcs_2012_wgs84"
dataFlnm="Pers_Mortage_PCS_2016-q3.xlsx"
#dataFlnm = "SME_Lending_PCS_2016-q3.xlsx"
placeName = "London"
colName = 'index'
print 'Search ranges in ' + dataFlnm + ' ...'
rangesList = scrape.search_Ranges_WorkBk(dataFlnm,placeName)
### - CAREFUL, IT TAKES ALTO THE TOTALS
print 'Building Dataframe from ' + dataFlnm + ' ...'
dataFile = scrape.from_Rng_to_DataFrame(dataFlnm,rangesList)
print 'Analyzing market data...'
dataFile = analyze.add_Index_with_OLS(dataFile)
print 'Building map frame using ' + mapName + ' ...'
mapDataPlot.mP_data(mapName,colName,dataFile);