Visualizing SanDiego's

COVID19 Data

in a Browser

using Python

Bala Juluri

SanDiego Python Meetup. May 2020

Motivation

Cases by ZipCodes

  • SanDiego County provides "Cases by ZipCode" as PDF's tables
  • Geo-spatial pattern? -> Map would be interesting
  • Cases changing with time? -> Interactive Visualization in browser.
  • Visualization Pipeline

    Jupyter Notebook Link

    https://tinyurl.com/sd-covid-nb

    Bokeh

    • Python Visualization Library for Web Browsers
    • Plots, Dashboards and Data applications
    • Python Code -> JSON -> BOKEHJS client library
    • Interactivity (Pan, Zoom, Inspectors,Selection) Tools
    • NO JAVASCRIPT CODING REQUIRED

    Ways to use Bokeh

    • Jupyter notebook
    • Bokeh Applications:
      • Run in server mode.
      • Synchronize between Python and Browser
      • 100% Python code including callbacks
    • Standalone HTML:
      • Self-contained HTML with Data, Javascript and CSS.
      • No need for a server
      • Callbacks are written in Javascript

    Tabula-Py

    • Convert tables in PDF to DataFrame, JSON, CSV
    • 'read_pdf()' and 'read_pdf_with_template()'

    Other Helpers

    • mapshaper.org
      • Simplify GeoJSON map to decrease HTML file size for faster load time
    • FileCmp
      • Part of Python Standard Lib.
      • Compares files/PDF's based on the content or status of file (os.stats)

    Questions?

    Slides

    https://tinyurl.com/sd-covid-slides