Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Example of Proxy Model InfectionRateVisualization
from visualizations.models import Visualization
class InfectionRateVisualization(Visualization):
class Meta:
proxy = True
def from_data(csvfile):
department_instances = []
infection_type = []
with open csvfile as file:
if file["department"] and file["type"]:
department_instances = np.array(file["department"])
infection_type = np.array(file["type"])
return IncompleteDataException("Please include a department and a type column in your CSV.")
map = HeatMap(list(zip(department_instances, infection_type)))
return map.to_svg()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment