In [ ]:
import hmis
import plotly
plotly.offline.init_notebook_mode()
import matplotlib.pylab as plt
%matplotlib notebook
import folium
import time as time
In [ ]:
# The name of the dictionary file that must be read in.
filename = '../test_data/hmis_test_data.pkl'
# Pull out the information on all the people
people = hmis.read_dictionary_file(filename)
In [ ]:
# Pull out a subset of people based on their ages.
# This function returns a list of dicionaries, just like the original list of people.
# The range of ages to be analyzed.
lo=20
hi=60
ppl_based_on_age = hmis.select_by_age(people,lo=lo,hi=hi)
In [ ]:
# Mapping the locations of the programs on a map from folium's package.
# This mapping is the clustering with the exploded view.
# This plots each program, even if there are repeats in order for the clustering
# to accurately represent how many individuals have been to that program.
map1 =hmis.plot_program_locations(ppl_based_on_age, cluster=True, exploded=True)
map1
In [ ]:
# Mapping the locations of the programs on a map from folium's package.
# This is WITHOUT the exploded view of the clustering. The number reprresenting on the
# marker shows the number of programs in the area.
map2 = hmis.plot_program_locations(ppl_based_on_age, cluster=True, exploded=False)
map2
In [ ]:
# Mapping the locations of the programs on a map from folium's package.
# This is WITHOUT clustering but accurately shows the number of individuals
# at each program by the size of the marker and by clicking on each marker.
map3 =hmis.plot_program_locations(ppl_based_on_age, cluster=False)
map3
In [ ]:
# Get the list of dictionaries of the individuals.
num_of_programs = 1
ppl_based_on_programs = hmis.select_by_number_of_programs(people,num_of_programs)
#print(ppl_based_on_programs)
In [ ]:
# This mapping is the clustering with the exploded view.
# This plots each program, even if there are repeats in order for the clustering
# to accurately represent how many individuals have been to that program.
map4 =hmis.plot_program_locations(ppl_based_on_programs, cluster=True, exploded=True)
map4
In [ ]:
# This is WITHOUT the exploded view of the clustering. The number reprresenting on the
# marker shows the number of programs in the area.
map5 =hmis.plot_program_locations(ppl_based_on_age, cluster=True, exploded=False)
map5
In [ ]:
# Mapping the locations of the programs
map6 =hmis.plot_program_locations(ppl_based_on_programs, cluster=False)
map6
In [ ]:
In [ ]:
In [ ]: